@parca/profile 0.16.99 → 0.16.101

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 CHANGED
@@ -3,6 +3,14 @@
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.16.101](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.96...@parca/profile@0.16.101) (2023-01-25)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## 0.16.100 (2023-01-22)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.99](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.98...@parca/profile@0.16.99) (2023-01-19)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CallgraphNode, FlamegraphNode, FlamegraphNodeMeta, FlamegraphRootNode } from '@parca/client';
3
- import { Function, Location, Mapping } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
3
+ import { Function as ParcaFunction, Location, Mapping } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
4
4
  interface GraphTooltipProps {
5
5
  x: number;
6
6
  y: number;
@@ -13,7 +13,7 @@ interface GraphTooltipProps {
13
13
  strings?: string[];
14
14
  mappings?: Mapping[];
15
15
  locations?: Location[];
16
- functions?: Function[];
16
+ functions?: ParcaFunction[];
17
17
  }
18
18
  export interface HoveringNode extends CallgraphNode, FlamegraphRootNode, FlamegraphNode {
19
19
  diff: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Flamegraph, FlamegraphNode, FlamegraphRootNode } from '@parca/client';
3
- import { Mapping, Function, Location } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
3
+ import { Mapping, Function as ParcaFunction, Location } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
4
4
  interface IcicleGraphProps {
5
5
  graph: Flamegraph;
6
6
  sampleUnit: string;
@@ -13,7 +13,7 @@ interface IcicleGraphNodesProps {
13
13
  strings: string[];
14
14
  mappings: Mapping[];
15
15
  locations: Location[];
16
- functions: Function[];
16
+ functions: ParcaFunction[];
17
17
  x: number;
18
18
  y: number;
19
19
  total: number;
@@ -30,7 +30,7 @@ interface IcicleGraphRootNodeProps {
30
30
  strings: string[];
31
31
  mappings: Mapping[];
32
32
  locations: Location[];
33
- functions: Function[];
33
+ functions: ParcaFunction[];
34
34
  xScale: (value: number) => number;
35
35
  total: number;
36
36
  totalWidth: number;
@@ -38,7 +38,7 @@ interface IcicleGraphRootNodeProps {
38
38
  setCurPath: (path: string[]) => void;
39
39
  setHoveringNode: (node: FlamegraphNode | FlamegraphRootNode | undefined) => void;
40
40
  }
41
- export declare function nodeLabel(node: FlamegraphNode, strings: string[], mappings: Mapping[], locations: Location[], functions: Function[]): string;
41
+ export declare function nodeLabel(node: FlamegraphNode, strings: string[], mappings: Mapping[], locations: Location[], functions: ParcaFunction[]): string;
42
42
  export declare function IcicleGraphNodes({ data, strings, mappings, locations, functions, x, y, xScale, total, totalWidth, level, setHoveringNode, path, setCurPath, curPath, }: IcicleGraphNodesProps): JSX.Element;
43
43
  export declare function IcicleGraphRootNode({ node, strings, mappings, locations, functions, xScale, total, totalWidth, setHoveringNode, setCurPath, curPath, }: IcicleGraphRootNodeProps): JSX.Element;
44
44
  export default function IcicleGraph({ graph, width, setCurPath, curPath, sampleUnit, }: IcicleGraphProps): JSX.Element;
@@ -22,7 +22,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
22
22
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
23
  // See the License for the specific language governing permissions and
24
24
  // limitations under the License.
25
- import React, { useEffect, useMemo, useRef, useState } from 'react';
25
+ import { useEffect, useMemo, useRef, useState, memo, Fragment } from 'react';
26
26
  import { throttle } from 'lodash';
27
27
  import { pointer } from 'd3-selection';
28
28
  import { scaleLinear } from 'd3-scale';
@@ -117,10 +117,10 @@ export function IcicleGraphNodes(_a) {
117
117
  return;
118
118
  setHoveringNode(undefined);
119
119
  };
120
- return (_jsxs(React.Fragment, { children: [_jsx(IcicleRect, { x: xStart, y: 0, width: width, height: RowHeight, name: name, color: color, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, curPath: curPath }, "rect-".concat(key)), data !== undefined && data.length > 0 && (_jsx(IcicleGraphNodes, { data: d.children, strings: strings, mappings: mappings, locations: locations, functions: functions, x: xStart, y: RowHeight, xScale: newXScale, total: total, totalWidth: totalWidth, level: nextLevel, setHoveringNode: setHoveringNode, path: nextPath, curPath: nextCurPath, setCurPath: setCurPath }, "node-".concat(key)))] }, "node-".concat(key)));
120
+ return (_jsxs(Fragment, { children: [_jsx(IcicleRect, { x: xStart, y: 0, width: width, height: RowHeight, name: name, color: color, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, curPath: curPath }, "rect-".concat(key)), data !== undefined && data.length > 0 && (_jsx(IcicleGraphNodes, { data: d.children, strings: strings, mappings: mappings, locations: locations, functions: functions, x: xStart, y: RowHeight, xScale: newXScale, total: total, totalWidth: totalWidth, level: nextLevel, setHoveringNode: setHoveringNode, path: nextPath, curPath: nextCurPath, setCurPath: setCurPath }, "node-".concat(key)))] }, "node-".concat(key)));
121
121
  }) })));
122
122
  }
123
- var MemoizedIcicleGraphNodes = React.memo(IcicleGraphNodes);
123
+ var MemoizedIcicleGraphNodes = memo(IcicleGraphNodes);
124
124
  export function IcicleGraphRootNode(_a) {
125
125
  var node = _a.node, strings = _a.strings, mappings = _a.mappings, locations = _a.locations, functions = _a.functions, xScale = _a.xScale, total = _a.total, totalWidth = _a.totalWidth, setHoveringNode = _a.setHoveringNode, setCurPath = _a.setCurPath, curPath = _a.curPath;
126
126
  var isDarkMode = useAppSelector(selectDarkMode);
@@ -142,7 +142,7 @@ export function IcicleGraphRootNode(_a) {
142
142
  var path = [];
143
143
  return (_jsxs("g", __assign({ transform: 'translate(0, 0)' }, { children: [_jsx(IcicleRect, { x: 0, y: 0, width: totalWidth, height: RowHeight, name: 'root', color: color, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, curPath: curPath }), _jsx(MemoizedIcicleGraphNodes, { data: node.children, strings: strings, mappings: mappings, locations: locations, functions: functions, x: 0, y: RowHeight, xScale: xScale, total: total, totalWidth: totalWidth, level: 0, setHoveringNode: setHoveringNode, path: path, curPath: curPath, setCurPath: setCurPath })] })));
144
144
  }
145
- var MemoizedIcicleGraphRootNode = React.memo(IcicleGraphRootNode);
145
+ var MemoizedIcicleGraphRootNode = memo(IcicleGraphRootNode);
146
146
  export default function IcicleGraph(_a) {
147
147
  var graph = _a.graph, width = _a.width, setCurPath = _a.setCurPath, curPath = _a.curPath, sampleUnit = _a.sampleUnit;
148
148
  var _b = useState(), hoveringNode = _b[0], setHoveringNode = _b[1];
@@ -10,6 +10,18 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
13
+ // Copyright 2022 The Parca Authors
14
+ // Licensed under the Apache License, Version 2.0 (the "License");
15
+ // you may not use this file except in compliance with the License.
16
+ // You may obtain a copy of the License at
17
+ //
18
+ // http://www.apache.org/licenses/LICENSE-2.0
19
+ //
20
+ // Unless required by applicable law or agreed to in writing, software
21
+ // distributed under the License is distributed on an "AS IS" BASIS,
22
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ // See the License for the specific language governing permissions and
24
+ // limitations under the License.
13
25
  import { formatDate } from '@parca/functions';
14
26
  import { Query, ProfileType } from '@parca/parser';
15
27
  import { QueryRequest_Mode, QueryRequest_ReportType, ProfileDiffSelection_Mode, Timestamp, } from '@parca/client';
@@ -41,13 +41,13 @@ import { Icon } from '@iconify/react';
41
41
  import { Button, Card, useParcaContext } from '@parca/components';
42
42
  import { useContainerDimensions } from '@parca/dynamicsize';
43
43
  import { useAppSelector, selectDarkMode } from '@parca/store';
44
- import { DragDropContext, Droppable, Draggable, } from 'react-beautiful-dnd';
44
+ import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
45
45
  import { Callgraph } from '../';
46
46
  import ProfileShareButton from '../components/ProfileShareButton';
47
47
  import FilterByFunctionButton from './FilterByFunctionButton';
48
48
  import ViewSelector from './ViewSelector';
49
49
  import ProfileIcicleGraph from '../ProfileIcicleGraph';
50
- import TopTable from '../TopTable';
50
+ import { TopTable } from '../TopTable';
51
51
  import useDelayedLoader from '../useDelayedLoader';
52
52
  import '../ProfileView.styles.css';
53
53
  function arrayEquals(a, b) {
@@ -22,7 +22,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
22
22
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
23
  // See the License for the specific language governing permissions and
24
24
  // limitations under the License.
25
- import React, { useCallback, useMemo } from 'react';
25
+ import { useCallback, useMemo } from 'react';
26
26
  import { getLastItem, valueFormatter, isSearchMatch, parseParams, selectQueryParam, } from '@parca/functions';
27
27
  import { Table } from '@parca/components';
28
28
  import { createColumnHelper } from '@tanstack/react-table';
@@ -54,7 +54,7 @@ export var TopTable = function (_a) {
54
54
  var router = parseParams(window.location.search);
55
55
  var currentSearchString = selectQueryParam('search_string');
56
56
  var compareMode = Boolean(selectQueryParam('compare_a')) && Boolean(selectQueryParam('compare_b'));
57
- var columns = React.useMemo(function () {
57
+ var columns = useMemo(function () {
58
58
  var cols = [
59
59
  columnHelper.accessor('meta', {
60
60
  header: function () { return _jsx("span", __assign({ className: "text-left" }, { children: "Name" })); },
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import type { Props as CallgraphProps } from '@parca/profile/src/Callgraph';
3
3
  import ProfileExplorer from './ProfileExplorer';
4
4
  import ProfileTypeSelector from './ProfileTypeSelector';
@@ -12,7 +12,7 @@ export * from './ProfileViewWithData';
12
12
  export * from './utils';
13
13
  export * from './ProfileTypeSelector';
14
14
  export type { CallgraphProps };
15
- declare const Callgraph: React.LazyExoticComponent<({ graph, sampleUnit, width, colorRange }: CallgraphProps) => JSX.Element>;
15
+ declare const Callgraph: import("react").LazyExoticComponent<({ graph, sampleUnit, width, colorRange }: CallgraphProps) => JSX.Element>;
16
16
  export { Callgraph, ProfileExplorer, ProfileTypeSelector };
17
17
  interface GrafanaParcaDataPayload {
18
18
  flamegraphData: FlamegraphData;
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
47
  }
48
48
  };
49
- import React from 'react';
49
+ import { lazy } from 'react';
50
50
  import ProfileExplorer from './ProfileExplorer';
51
51
  import ProfileTypeSelector from './ProfileTypeSelector';
52
52
  export * from './IcicleGraph';
@@ -56,7 +56,7 @@ export * from './ProfileView';
56
56
  export * from './ProfileViewWithData';
57
57
  export * from './utils';
58
58
  export * from './ProfileTypeSelector';
59
- var Callgraph = React.lazy(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
59
+ var Callgraph = lazy(function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
60
60
  switch (_a.label) {
61
61
  case 0: return [4 /*yield*/, import('@parca/profile/src/Callgraph')];
62
62
  case 1: return [2 /*return*/, _a.sent()];
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QueryRequest, QueryServiceClient } from '@parca/client';
2
- import { RpcMetadata } from '@protobuf-ts/runtime-rpc';
2
+ import type { RpcMetadata } from '@protobuf-ts/runtime-rpc';
3
3
  export declare const hexifyAddress: (address?: string) => string;
4
4
  export declare const downloadPprof: (request: QueryRequest, queryClient: QueryServiceClient, metadata: RpcMetadata) => Promise<Blob>;
5
5
  export declare const truncateString: (str: string, num: number) => string;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.99",
3
+ "version": "0.16.101",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.62",
7
- "@parca/components": "^0.16.86",
7
+ "@parca/components": "^0.16.88",
8
8
  "@parca/dynamicsize": "^0.16.52",
9
- "@parca/functions": "^0.16.58",
9
+ "@parca/functions": "^0.16.59",
10
10
  "@parca/parser": "^0.16.53",
11
- "@parca/store": "^0.16.52",
11
+ "@parca/store": "^0.16.53",
12
12
  "@types/react-beautiful-dnd": "^13.1.3",
13
- "d3": "7.8.1",
13
+ "d3": "7.8.2",
14
14
  "d3-scale": "^4.0.2",
15
15
  "d3-selection": "3.0.0",
16
16
  "graphviz-wasm": "3.0.0",
@@ -44,5 +44,5 @@
44
44
  "access": "public",
45
45
  "registry": "https://registry.npmjs.org/"
46
46
  },
47
- "gitHead": "3d484f094986f967437503c9935fb7414b690fe1"
47
+ "gitHead": "4f76548f34c4efe032fc04d91c19777d6ea05de9"
48
48
  }
@@ -15,7 +15,7 @@ import {useState, useEffect, useRef} from 'react';
15
15
  import graphviz from 'graphviz-wasm';
16
16
  import * as d3 from 'd3';
17
17
  import {Stage, Layer, Rect, Arrow, Text, Label} from 'react-konva';
18
- import {KonvaEventObject} from 'konva/lib/Node';
18
+ import type {KonvaEventObject} from 'konva/lib/Node';
19
19
  import {Button} from '@parca/components';
20
20
  import {CallgraphNode, CallgraphEdge, Callgraph as CallgraphType} from '@parca/client';
21
21
  import {jsonToDot, getCurvePoints} from './utils';
@@ -19,7 +19,11 @@ import {CallgraphNode, FlamegraphNode, FlamegraphNodeMeta, FlamegraphRootNode} f
19
19
  import {getLastItem, valueFormatter} from '@parca/functions';
20
20
  import useIsShiftDown from '@parca/components/src/hooks/useIsShiftDown';
21
21
  import {hexifyAddress, truncateString} from '../';
22
- import {Function, Location, Mapping} from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
22
+ import {
23
+ Function as ParcaFunction,
24
+ Location,
25
+ Mapping,
26
+ } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
23
27
 
24
28
  interface GraphTooltipProps {
25
29
  x: number;
@@ -33,7 +37,7 @@ interface GraphTooltipProps {
33
37
  strings?: string[];
34
38
  mappings?: Mapping[];
35
39
  locations?: Location[];
36
- functions?: Function[];
40
+ functions?: ParcaFunction[];
37
41
  }
38
42
 
39
43
  const virtualElement = {
@@ -76,7 +80,7 @@ const TooltipMetaInfo = ({
76
80
  strings?: string[];
77
81
  mappings?: Mapping[];
78
82
  locations?: Location[];
79
- functions?: Function[];
83
+ functions?: ParcaFunction[];
80
84
  }): JSX.Element => {
81
85
  if (hoveringNode.meta === undefined) return <></>;
82
86
 
@@ -219,7 +223,7 @@ const GraphTooltipContent = ({
219
223
  strings?: string[];
220
224
  mappings?: Mapping[];
221
225
  locations?: Location[];
222
- functions?: Function[];
226
+ functions?: ParcaFunction[];
223
227
  }): JSX.Element => {
224
228
  const [isCopied, setIsCopied] = useState<boolean>(false);
225
229
 
@@ -11,14 +11,18 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import React, {MouseEvent, useEffect, useMemo, useRef, useState} from 'react';
14
+ import {MouseEvent, useEffect, useMemo, useRef, useState, memo, Fragment} from 'react';
15
15
 
16
16
  import {throttle} from 'lodash';
17
17
  import {pointer} from 'd3-selection';
18
18
  import {scaleLinear} from 'd3-scale';
19
19
 
20
20
  import {Flamegraph, FlamegraphNode, FlamegraphRootNode} from '@parca/client';
21
- import {Mapping, Function, Location} from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
21
+ import {
22
+ Mapping,
23
+ Function as ParcaFunction,
24
+ Location,
25
+ } from '@parca/client/dist/parca/metastore/v1alpha1/metastore';
22
26
  import type {HoveringNode} from './GraphTooltip';
23
27
  import GraphTooltip from './GraphTooltip';
24
28
  import {diffColor, getLastItem, isSearchMatch, selectQueryParam} from '@parca/functions';
@@ -40,7 +44,7 @@ interface IcicleGraphNodesProps {
40
44
  strings: string[];
41
45
  mappings: Mapping[];
42
46
  locations: Location[];
43
- functions: Function[];
47
+ functions: ParcaFunction[];
44
48
  x: number;
45
49
  y: number;
46
50
  total: number;
@@ -58,7 +62,7 @@ interface IcicleGraphRootNodeProps {
58
62
  strings: string[];
59
63
  mappings: Mapping[];
60
64
  locations: Location[];
61
- functions: Function[];
65
+ functions: ParcaFunction[];
62
66
  xScale: (value: number) => number;
63
67
  total: number;
64
68
  totalWidth: number;
@@ -147,7 +151,7 @@ export function nodeLabel(
147
151
  strings: string[],
148
152
  mappings: Mapping[],
149
153
  locations: Location[],
150
- functions: Function[]
154
+ functions: ParcaFunction[]
151
155
  ): string {
152
156
  if (node.meta?.locationIndex === undefined) return '<unknown>';
153
157
  if (node.meta?.locationIndex === 0) return '<unknown>';
@@ -161,7 +165,7 @@ export function nodeLabel(
161
165
  const mappingFile =
162
166
  mapping?.fileStringIndex !== undefined ? strings[mapping.fileStringIndex] : '';
163
167
 
164
- const mappingString: string = `${
168
+ const mappingString = `${
165
169
  mappingFile !== '' ? '[' + (getLastItem(mappingFile) ?? '') + '] ' : ''
166
170
  }`;
167
171
 
@@ -251,7 +255,7 @@ export function IcicleGraphNodes({
251
255
  };
252
256
 
253
257
  return (
254
- <React.Fragment key={`node-${key}`}>
258
+ <Fragment key={`node-${key}`}>
255
259
  <IcicleRect
256
260
  key={`rect-${key}`}
257
261
  x={xStart}
@@ -285,14 +289,14 @@ export function IcicleGraphNodes({
285
289
  setCurPath={setCurPath}
286
290
  />
287
291
  )}
288
- </React.Fragment>
292
+ </Fragment>
289
293
  );
290
294
  })}
291
295
  </g>
292
296
  );
293
297
  }
294
298
 
295
- const MemoizedIcicleGraphNodes = React.memo(IcicleGraphNodes);
299
+ const MemoizedIcicleGraphNodes = memo(IcicleGraphNodes);
296
300
 
297
301
  export function IcicleGraphRootNode({
298
302
  node,
@@ -363,7 +367,7 @@ export function IcicleGraphRootNode({
363
367
  );
364
368
  }
365
369
 
366
- const MemoizedIcicleGraphRootNode = React.memo(IcicleGraphRootNode);
370
+ const MemoizedIcicleGraphRootNode = memo(IcicleGraphRootNode);
367
371
 
368
372
  export default function IcicleGraph({
369
373
  graph,
@@ -422,7 +422,7 @@ export const RawMetricsGraph = ({
422
422
  }
423
423
 
424
424
  let s: Series | null = null;
425
- let seriesIndex: number = -1;
425
+ let seriesIndex = -1;
426
426
 
427
427
  outer: for (let i = 0; i < series.length; i++) {
428
428
  const keys = profile.labels.map(e => e.name);
@@ -45,7 +45,7 @@ const ProfileExplorerSingle = ({
45
45
  querySelection={query}
46
46
  selectQuery={selectQuery}
47
47
  selectProfile={selectProfile}
48
- closeProfile={() => {}}
48
+ closeProfile={() => {}} // eslint-disable-line @typescript-eslint/no-empty-function
49
49
  profileSelection={profile}
50
50
  comparing={false}
51
51
  onCompareProfile={compareProfile}
@@ -11,7 +11,6 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import React from 'react';
15
14
  import {formatDate} from '@parca/functions';
16
15
  import {Query, ProfileType} from '@parca/parser';
17
16
  import {
@@ -354,7 +353,7 @@ export class MergedProfileSource implements ProfileSource {
354
353
  Describe(): JSX.Element {
355
354
  return (
356
355
  <a>
357
- Merge of "{this.query}" from {formatDate(this.from, timeFormat)} to{' '}
356
+ Merge of &quot;{this.query}&quot; from {formatDate(this.from, timeFormat)} to{' '}
358
357
  {formatDate(this.to, timeFormat)}
359
358
  </a>
360
359
  );
@@ -11,10 +11,11 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import React, {useMemo} from 'react';
14
+ import {useMemo} from 'react';
15
15
  import {ProfileType, ProfileTypesResponse} from '@parca/client';
16
16
  import {RpcError} from '@protobuf-ts/runtime-rpc';
17
- import {SelectElement, Select} from '@parca/components';
17
+ import {Select} from '@parca/components';
18
+ import type {SelectElement} from '@parca/components';
18
19
 
19
20
  interface WellKnownProfile {
20
21
  name: string;
@@ -11,7 +11,8 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import {Select, SelectElement} from '@parca/components';
14
+ import {Select} from '@parca/components';
15
+ import type {SelectElement} from '@parca/components';
15
16
  import {useURLState, NavigateFunction} from '@parca/functions';
16
17
  import useUIFeatureFlag from '@parca/functions/useUIFeatureFlag';
17
18
 
@@ -22,13 +22,8 @@ import {QueryServiceClient, Flamegraph, Top, Callgraph as CallgraphType} from '@
22
22
  import {Button, Card, useParcaContext} from '@parca/components';
23
23
  import {useContainerDimensions} from '@parca/dynamicsize';
24
24
  import {useAppSelector, selectDarkMode} from '@parca/store';
25
- import {
26
- DragDropContext,
27
- Droppable,
28
- Draggable,
29
- DropResult,
30
- DraggableLocation,
31
- } from 'react-beautiful-dnd';
25
+ import {DragDropContext, Droppable, Draggable} from 'react-beautiful-dnd';
26
+ import type {DropResult, DraggableLocation} from 'react-beautiful-dnd';
32
27
 
33
28
  import {Callgraph} from '../';
34
29
  import ProfileShareButton from '../components/ProfileShareButton';
@@ -36,7 +31,7 @@ import FilterByFunctionButton from './FilterByFunctionButton';
36
31
  import ViewSelector from './ViewSelector';
37
32
  import ProfileIcicleGraph, {ResizeHandler} from '../ProfileIcicleGraph';
38
33
  import {ProfileSource} from '../ProfileSource';
39
- import TopTable from '../TopTable';
34
+ import {TopTable} from '../TopTable';
40
35
  import useDelayedLoader from '../useDelayedLoader';
41
36
 
42
37
  import '../ProfileView.styles.css';
@@ -11,7 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import React, {useCallback, useMemo} from 'react';
14
+ import {useCallback, useMemo} from 'react';
15
15
 
16
16
  import {
17
17
  getLastItem,
@@ -23,7 +23,8 @@ import {
23
23
  } from '@parca/functions';
24
24
  import {TopNode, TopNodeMeta, Top} from '@parca/client';
25
25
  import {Table} from '@parca/components';
26
- import {createColumnHelper, ColumnDef} from '@tanstack/react-table';
26
+ import {createColumnHelper} from '@tanstack/react-table';
27
+ import type {ColumnDef} from '@tanstack/react-table';
27
28
 
28
29
  import {hexifyAddress} from '../utils';
29
30
 
@@ -67,7 +68,7 @@ export const TopTable = ({data: top, sampleUnit: unit, navigateTo}: TopTableProp
67
68
  const compareMode =
68
69
  Boolean(selectQueryParam('compare_a')) && Boolean(selectQueryParam('compare_b'));
69
70
 
70
- const columns = React.useMemo(() => {
71
+ const columns = useMemo(() => {
71
72
  const cols: Array<ColumnDef<TopNode, any>> = [
72
73
  columnHelper.accessor('meta', {
73
74
  header: () => <span className="text-left">Name</span>,
package/src/index.tsx CHANGED
@@ -11,7 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import React from 'react';
14
+ import {lazy} from 'react';
15
15
  import type {Props as CallgraphProps} from '@parca/profile/src/Callgraph';
16
16
  import ProfileExplorer from './ProfileExplorer';
17
17
  import ProfileTypeSelector from './ProfileTypeSelector';
@@ -28,7 +28,7 @@ export * from './ProfileTypeSelector';
28
28
 
29
29
  export type {CallgraphProps};
30
30
 
31
- const Callgraph = React.lazy(async () => await import('@parca/profile/src/Callgraph'));
31
+ const Callgraph = lazy(async () => await import('@parca/profile/src/Callgraph'));
32
32
 
33
33
  export {Callgraph, ProfileExplorer, ProfileTypeSelector};
34
34
 
package/src/utils.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  // limitations under the License.
13
13
 
14
14
  import {QueryRequest, QueryRequest_ReportType, QueryServiceClient} from '@parca/client';
15
- import {RpcMetadata} from '@protobuf-ts/runtime-rpc';
15
+ import type {RpcMetadata} from '@protobuf-ts/runtime-rpc';
16
16
 
17
17
  export const hexifyAddress = (address?: string): string => {
18
18
  if (address == null) {