@parca/profile 0.14.31 → 0.14.36
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 +15 -0
- package/package.json +4 -4
- package/src/IcicleGraph.tsx +10 -10
- package/src/ProfileIcicleGraph.tsx +1 -1
- package/src/ProfileView.tsx +5 -5
- package/src/ProfileViewWithData.tsx +1 -1
- package/src/TopTable.tsx +20 -5
- package/src/components/DiffLegend.tsx +4 -4
- package/src/components/ProfileShareButton/ResultBox.tsx +2 -2
- package/src/components/ProfileShareButton/index.tsx +4 -4
- package/src/useDelayedLoader.ts +1 -1
- package/src/utils.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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.36](https://github.com/parca-dev/parca/compare/ui-v0.14.35...ui-v0.14.36) (2022-08-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui:** enforce @typescript-eslint/explicit-function-return-type ([22a18fd](https://github.com/parca-dev/parca/commit/22a18fd3f7befef5cc175131d8c997c3967a5713))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 0.14.32 (2022-08-18)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [0.14.31](https://github.com/parca-dev/parca/compare/ui-v0.14.30...ui-v0.14.31) (2022-08-18)
|
|
7
22
|
|
|
8
23
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.36",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@iconify/react": "^3.2.2",
|
|
7
7
|
"@parca/client": "^0.14.16",
|
|
8
|
-
"@parca/dynamicsize": "^0.14.
|
|
9
|
-
"@parca/parser": "^0.14.
|
|
8
|
+
"@parca/dynamicsize": "^0.14.36",
|
|
9
|
+
"@parca/parser": "^0.14.36",
|
|
10
10
|
"d3-scale": "^4.0.2",
|
|
11
11
|
"d3-selection": "3.0.0",
|
|
12
12
|
"react-copy-to-clipboard": "^5.1.0"
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"access": "public",
|
|
23
23
|
"registry": "https://registry.npmjs.org/"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "7d75476b99eafbb9e9d3976c1de6cfb88cbfc8c2"
|
|
26
26
|
}
|
package/src/IcicleGraph.tsx
CHANGED
|
@@ -91,7 +91,7 @@ function IcicleRect({
|
|
|
91
91
|
onMouseLeave,
|
|
92
92
|
onClick,
|
|
93
93
|
curPath,
|
|
94
|
-
}: IcicleRectProps) {
|
|
94
|
+
}: IcicleRectProps): JSX.Element {
|
|
95
95
|
const currentSearchString = useAppSelector(selectSearchNodeString);
|
|
96
96
|
const isFaded = curPath.length > 0 && name !== curPath[curPath.length - 1];
|
|
97
97
|
const styles = isFaded ? fadedIcicleRectStyles : icicleRectStyles;
|
|
@@ -158,7 +158,7 @@ export function IcicleGraphNodes({
|
|
|
158
158
|
path,
|
|
159
159
|
setCurPath,
|
|
160
160
|
curPath,
|
|
161
|
-
}: IcicleGraphNodesProps) {
|
|
161
|
+
}: IcicleGraphNodesProps): JSX.Element {
|
|
162
162
|
const isDarkMode = useAppSelector(selectDarkMode);
|
|
163
163
|
|
|
164
164
|
const nodes =
|
|
@@ -189,7 +189,7 @@ export function IcicleGraphNodes({
|
|
|
189
189
|
|
|
190
190
|
const color = diffColor(diff, cumulative, isDarkMode);
|
|
191
191
|
|
|
192
|
-
const onClick = () => {
|
|
192
|
+
const onClick = (): void => {
|
|
193
193
|
setCurPath(nextPath);
|
|
194
194
|
};
|
|
195
195
|
|
|
@@ -199,8 +199,8 @@ export function IcicleGraphNodes({
|
|
|
199
199
|
? scaleLinear().domain([0, cumulative]).range([0, totalWidth])
|
|
200
200
|
: xScale;
|
|
201
201
|
|
|
202
|
-
const onMouseEnter = () => setHoveringNode(d);
|
|
203
|
-
const onMouseLeave = () => setHoveringNode(undefined);
|
|
202
|
+
const onMouseEnter = (): void => setHoveringNode(d);
|
|
203
|
+
const onMouseLeave = (): void => setHoveringNode(undefined);
|
|
204
204
|
|
|
205
205
|
return (
|
|
206
206
|
<React.Fragment key={`node-${key}`}>
|
|
@@ -250,16 +250,16 @@ export function IcicleGraphRootNode({
|
|
|
250
250
|
setHoveringNode,
|
|
251
251
|
setCurPath,
|
|
252
252
|
curPath,
|
|
253
|
-
}: IcicleGraphRootNodeProps) {
|
|
253
|
+
}: IcicleGraphRootNodeProps): JSX.Element {
|
|
254
254
|
const isDarkMode = useAppSelector(selectDarkMode);
|
|
255
255
|
|
|
256
256
|
const cumulative = parseFloat(node.cumulative);
|
|
257
257
|
const diff = parseFloat(node.diff);
|
|
258
258
|
const color = diffColor(diff, cumulative, isDarkMode);
|
|
259
259
|
|
|
260
|
-
const onClick = () => setCurPath([]);
|
|
261
|
-
const onMouseEnter = () => setHoveringNode(node);
|
|
262
|
-
const onMouseLeave = () => setHoveringNode(undefined);
|
|
260
|
+
const onClick = (): void => setCurPath([]);
|
|
261
|
+
const onMouseEnter = (): void => setHoveringNode(node);
|
|
262
|
+
const onMouseLeave = (): void => setHoveringNode(undefined);
|
|
263
263
|
const path = [];
|
|
264
264
|
|
|
265
265
|
return (
|
|
@@ -301,7 +301,7 @@ export default function IcicleGraph({
|
|
|
301
301
|
setCurPath,
|
|
302
302
|
curPath,
|
|
303
303
|
sampleUnit,
|
|
304
|
-
}: IcicleGraphProps) {
|
|
304
|
+
}: IcicleGraphProps): JSX.Element {
|
|
305
305
|
const [hoveringNode, setHoveringNode] = useState<
|
|
306
306
|
FlamegraphNode | FlamegraphRootNode | undefined
|
|
307
307
|
>();
|
|
@@ -31,7 +31,7 @@ const ProfileIcicleGraph = ({
|
|
|
31
31
|
curPath,
|
|
32
32
|
setNewCurPath,
|
|
33
33
|
sampleUnit,
|
|
34
|
-
}: ProfileIcicleGraphProps) => {
|
|
34
|
+
}: ProfileIcicleGraphProps): JSX.Element => {
|
|
35
35
|
const compareMode = useAppSelector(selectCompareMode);
|
|
36
36
|
const {ref, dimensions} = useContainerDimensions();
|
|
37
37
|
|
package/src/ProfileView.tsx
CHANGED
|
@@ -58,7 +58,7 @@ interface ProfileViewProps {
|
|
|
58
58
|
compare?: boolean;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
function arrayEquals(a, b): boolean {
|
|
61
|
+
function arrayEquals<T>(a: T[], b: T[]): boolean {
|
|
62
62
|
return (
|
|
63
63
|
Array.isArray(a) &&
|
|
64
64
|
Array.isArray(b) &&
|
|
@@ -124,7 +124,7 @@ export const ProfileView = ({
|
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
const downloadPProf = async (e: React.MouseEvent<HTMLElement>) => {
|
|
127
|
+
const downloadPProf = async (e: React.MouseEvent<HTMLElement>): Promise<void> => {
|
|
128
128
|
e.preventDefault();
|
|
129
129
|
if (profileSource == null || queryClient == null) {
|
|
130
130
|
return;
|
|
@@ -141,15 +141,15 @@ export const ProfileView = ({
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
-
const resetIcicleGraph = () => setCurPath([]);
|
|
144
|
+
const resetIcicleGraph = (): void => setCurPath([]);
|
|
145
145
|
|
|
146
|
-
const setNewCurPath = (path: string[]) => {
|
|
146
|
+
const setNewCurPath = (path: string[]): void => {
|
|
147
147
|
if (!arrayEquals(curPath, path)) {
|
|
148
148
|
setCurPath(path);
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
-
const switchProfileView = (view: VisualizationType) => {
|
|
152
|
+
const switchProfileView = (view: VisualizationType): void => {
|
|
153
153
|
if (view == null) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
@@ -30,7 +30,7 @@ export const ProfileViewWithData = ({
|
|
|
30
30
|
queryClient,
|
|
31
31
|
profileSource,
|
|
32
32
|
navigateTo,
|
|
33
|
-
}: ProfileViewWithDataProps) => {
|
|
33
|
+
}: ProfileViewWithDataProps): JSX.Element => {
|
|
34
34
|
const profileVisState = useProfileVisState();
|
|
35
35
|
const {currentView} = profileVisState;
|
|
36
36
|
const {
|
package/src/TopTable.tsx
CHANGED
|
@@ -26,7 +26,7 @@ interface TopTableProps {
|
|
|
26
26
|
sampleUnit: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const Arrow = ({direction}: {direction: string | undefined}) => {
|
|
29
|
+
const Arrow = ({direction}: {direction: string | undefined}): JSX.Element => {
|
|
30
30
|
return (
|
|
31
31
|
<svg
|
|
32
32
|
className={`${direction !== undefined ? 'fill-[#161616] dark:fill-[#ffffff]' : ''}`}
|
|
@@ -41,7 +41,22 @@ const Arrow = ({direction}: {direction: string | undefined}) => {
|
|
|
41
41
|
);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const useSortableData = (
|
|
44
|
+
const useSortableData = (
|
|
45
|
+
top?: Top,
|
|
46
|
+
config = {key: 'cumulative', direction: 'desc'}
|
|
47
|
+
): {
|
|
48
|
+
items:
|
|
49
|
+
| Array<{
|
|
50
|
+
diff: number;
|
|
51
|
+
cumulative: number;
|
|
52
|
+
flat: number;
|
|
53
|
+
name: string | undefined;
|
|
54
|
+
meta?: TopNodeMeta | undefined;
|
|
55
|
+
}>
|
|
56
|
+
| undefined;
|
|
57
|
+
requestSort: (key: string) => void;
|
|
58
|
+
sortConfig: {key: string; direction: string} | null;
|
|
59
|
+
} => {
|
|
45
60
|
const [sortConfig, setSortConfig] = React.useState<{key: string; direction: string} | null>(
|
|
46
61
|
config
|
|
47
62
|
);
|
|
@@ -74,7 +89,7 @@ const useSortableData = (top?: Top, config = {key: 'cumulative', direction: 'des
|
|
|
74
89
|
return sortableItems;
|
|
75
90
|
}, [items, sortConfig]);
|
|
76
91
|
|
|
77
|
-
const requestSort = (key: string) => {
|
|
92
|
+
const requestSort = (key: string): void => {
|
|
78
93
|
let direction = 'desc';
|
|
79
94
|
if (sortConfig != null && sortConfig.key === key && sortConfig.direction === 'desc') {
|
|
80
95
|
direction = 'asc';
|
|
@@ -112,14 +127,14 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
|
|
|
112
127
|
const total = top != null ? top.list.length : 0;
|
|
113
128
|
if (total === 0) return <>Profile has no samples</>;
|
|
114
129
|
|
|
115
|
-
const getClassNamesFor = (name: string) => {
|
|
130
|
+
const getClassNamesFor = (name: string): string | undefined => {
|
|
116
131
|
if (sortConfig == null) {
|
|
117
132
|
return;
|
|
118
133
|
}
|
|
119
134
|
return sortConfig.key === name ? sortConfig.direction : undefined;
|
|
120
135
|
};
|
|
121
136
|
|
|
122
|
-
const addPlusSign = (num: string) => {
|
|
137
|
+
const addPlusSign = (num: string): string => {
|
|
123
138
|
if (num.charAt(0) === '0' || num.charAt(0) === '-') {
|
|
124
139
|
return num;
|
|
125
140
|
}
|
|
@@ -25,7 +25,7 @@ const DiffLegendBar = ({
|
|
|
25
25
|
}: {
|
|
26
26
|
onMouseEnter: () => void;
|
|
27
27
|
onMouseLeave: () => void;
|
|
28
|
-
}) => {
|
|
28
|
+
}): JSX.Element => {
|
|
29
29
|
const isDarkMode = useAppSelector(selectDarkMode);
|
|
30
30
|
|
|
31
31
|
return (
|
|
@@ -54,7 +54,7 @@ const DiffLegendBar = ({
|
|
|
54
54
|
);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
const DiffLegend = () => {
|
|
57
|
+
const DiffLegend = (): JSX.Element => {
|
|
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);
|
|
@@ -64,10 +64,10 @@ const DiffLegend = () => {
|
|
|
64
64
|
strategy: 'absolute',
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
const handleMouseEnter = () => {
|
|
67
|
+
const handleMouseEnter = (): void => {
|
|
68
68
|
setShowLegendTooltip(true);
|
|
69
69
|
};
|
|
70
|
-
const handleMouseLeave = () => {
|
|
70
|
+
const handleMouseLeave = (): void => {
|
|
71
71
|
setShowLegendTooltip(false);
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -24,10 +24,10 @@ interface Props {
|
|
|
24
24
|
|
|
25
25
|
let timeoutHandle: ReturnType<typeof setTimeout> | null = null;
|
|
26
26
|
|
|
27
|
-
const ResultBox = ({value, className = ''}: Props) => {
|
|
27
|
+
const ResultBox = ({value, className = ''}: Props): JSX.Element => {
|
|
28
28
|
const [isCopied, setIsCopied] = useState<boolean>(false);
|
|
29
29
|
|
|
30
|
-
const onCopy = () => {
|
|
30
|
+
const onCopy = (): void => {
|
|
31
31
|
setIsCopied(true);
|
|
32
32
|
(window.document?.activeElement as HTMLElement)?.blur();
|
|
33
33
|
if (timeoutHandle != null) {
|
|
@@ -34,14 +34,14 @@ const ProfileShareModal = ({
|
|
|
34
34
|
closeModal,
|
|
35
35
|
queryRequest,
|
|
36
36
|
queryClient,
|
|
37
|
-
}: ProfileShareModalProps) => {
|
|
37
|
+
}: ProfileShareModalProps): JSX.Element => {
|
|
38
38
|
const [isShared, setIsShared] = useState(false);
|
|
39
39
|
const [loading, setLoading] = useState<boolean>(false);
|
|
40
40
|
const [error, setError] = useState<string>('');
|
|
41
41
|
const [description, setDescription] = useState<string>('');
|
|
42
42
|
const [sharedLink, setSharedLink] = useState<string>('');
|
|
43
43
|
const metadata = useGrpcMetadata();
|
|
44
|
-
const isFormDataValid = () => true;
|
|
44
|
+
const isFormDataValid = (): boolean => true;
|
|
45
45
|
|
|
46
46
|
const handleSubmit: () => Promise<void> = async () => {
|
|
47
47
|
try {
|
|
@@ -60,7 +60,7 @@ const ProfileShareModal = ({
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
const onClose = () => {
|
|
63
|
+
const onClose = (): void => {
|
|
64
64
|
setLoading(false);
|
|
65
65
|
setError('');
|
|
66
66
|
setDescription('');
|
|
@@ -113,7 +113,7 @@ const ProfileShareModal = ({
|
|
|
113
113
|
);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
const ProfileShareButton = ({queryRequest, queryClient}: Props) => {
|
|
116
|
+
const ProfileShareButton = ({queryRequest, queryClient}: Props): JSX.Element => {
|
|
117
117
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
118
118
|
|
|
119
119
|
return (
|
package/src/useDelayedLoader.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface DelayedLoaderOptions {
|
|
|
17
17
|
delay?: number;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const useDelayedLoader = (isLoading = false, options?: DelayedLoaderOptions) => {
|
|
20
|
+
const useDelayedLoader = (isLoading = false, options?: DelayedLoaderOptions): boolean => {
|
|
21
21
|
const {delay = 500} = options ?? {};
|
|
22
22
|
const [isLoaderVisible, setIsLoaderVisible] = useState<boolean>(false);
|
|
23
23
|
useEffect(() => {
|
package/src/utils.ts
CHANGED