@parca/profile 0.16.129 → 0.16.130

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,10 @@
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.130 (2023-03-06)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.129](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.128...@parca/profile@0.16.129) (2023-03-02)
7
11
 
8
12
  ## 0.16.1 (2023-03-02)
@@ -111,7 +111,7 @@ var Callgraph = function (_a) {
111
111
  var currentSearchString = (_b = selectQueryParam('search_string')) !== null && _b !== void 0 ? _b : '';
112
112
  var isSearchEmpty = currentSearchString === undefined || currentSearchString === '';
113
113
  var rawDashboardItems = useURLState({ param: 'dashboard_items' })[0];
114
- var dashboardItems = rawDashboardItems;
114
+ var dashboardItems = rawDashboardItems !== undefined ? rawDashboardItems : ['icicle'];
115
115
  useEffect(function () {
116
116
  var getDataWithPositions = function () { return __awaiter(void 0, void 0, void 0, function () {
117
117
  var dataAsDot, jsonGraph;
@@ -30,7 +30,7 @@ var ViewSelector = function (_a) {
30
30
  var _e = useURLState({
31
31
  param: 'dashboard_items',
32
32
  navigateTo: navigateTo,
33
- }), dashboardItems = _e[0], setDashboardItems = _e[1];
33
+ }), _f = _e[0], dashboardItems = _f === void 0 ? ['icicle'] : _f, setDashboardItems = _e[1];
34
34
  var allItems = [
35
35
  { key: 'table', canBeSelected: !dashboardItems.includes('table') },
36
36
  { key: 'icicle', canBeSelected: !dashboardItems.includes('icicle') },
@@ -63,7 +63,12 @@ export var ProfileView = function (_a) {
63
63
  navigateTo: navigateTo,
64
64
  }), rawDashboardItems = _d[0], setDashboardItems = _d[1];
65
65
  var currentSearchString = useURLState({ param: 'search_string' })[0];
66
- var dashboardItems = rawDashboardItems;
66
+ var dashboardItems = useMemo(function () {
67
+ if (rawDashboardItems !== undefined) {
68
+ return rawDashboardItems;
69
+ }
70
+ return ['icicle'];
71
+ }, [rawDashboardItems]);
67
72
  var isDarkMode = useAppSelector(selectDarkMode);
68
73
  var isMultiPanelView = dashboardItems.length > 1;
69
74
  var _e = useParcaContext(), loader = _e.loader, perf = _e.perf;
@@ -54,7 +54,12 @@ export var TopTable = React.memo(function TopTable(_a) {
54
54
  var rawDashboardItems = useURLState({ param: 'dashboard_items' })[0];
55
55
  var rawcompareMode = useURLState({ param: 'compare_a' })[0];
56
56
  var compareMode = rawcompareMode === undefined ? false : rawcompareMode === 'true';
57
- var dashboardItems = rawDashboardItems;
57
+ var dashboardItems = useMemo(function () {
58
+ if (rawDashboardItems !== undefined) {
59
+ return rawDashboardItems;
60
+ }
61
+ return ['icicle'];
62
+ }, [rawDashboardItems]);
58
63
  var columns = useMemo(function () {
59
64
  var cols = [
60
65
  columnHelper.accessor('meta', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.129",
3
+ "version": "0.16.130",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.65",
@@ -45,5 +45,5 @@
45
45
  "access": "public",
46
46
  "registry": "https://registry.npmjs.org/"
47
47
  },
48
- "gitHead": "ec6a751d5e3058e3a537e93b867b59cfadb050b1"
48
+ "gitHead": "2eb0e54d2fdb21adfd76f91deef4d8ab33362cac"
49
49
  }
@@ -186,7 +186,8 @@ const Callgraph = ({graph, sampleUnit, width, colorRange}: Props): JSX.Element =
186
186
  const isSearchEmpty = currentSearchString === undefined || currentSearchString === '';
187
187
  const [rawDashboardItems] = useURLState({param: 'dashboard_items'});
188
188
 
189
- const dashboardItems = rawDashboardItems as string[];
189
+ const dashboardItems =
190
+ rawDashboardItems !== undefined ? (rawDashboardItems as string[]) : ['icicle'];
190
191
 
191
192
  useEffect(() => {
192
193
  const getDataWithPositions = async (): Promise<void> => {
@@ -35,7 +35,7 @@ const ViewSelector = ({
35
35
  disabled = false,
36
36
  }: Props): JSX.Element => {
37
37
  const [callgraphEnabled] = useUIFeatureFlag('callgraph');
38
- const [dashboardItems, setDashboardItems] = useURLState({
38
+ const [dashboardItems = ['icicle'], setDashboardItems] = useURLState({
39
39
  param: 'dashboard_items',
40
40
  navigateTo,
41
41
  });
@@ -106,7 +106,14 @@ export const ProfileView = ({
106
106
  navigateTo,
107
107
  });
108
108
  const [currentSearchString] = useURLState({param: 'search_string'});
109
- const dashboardItems = rawDashboardItems as string[];
109
+
110
+ const dashboardItems = useMemo(() => {
111
+ if (rawDashboardItems !== undefined) {
112
+ return rawDashboardItems as string[];
113
+ }
114
+ return ['icicle'];
115
+ }, [rawDashboardItems]);
116
+
110
117
  const isDarkMode = useAppSelector(selectDarkMode);
111
118
  const isMultiPanelView = dashboardItems.length > 1;
112
119
 
@@ -76,7 +76,12 @@ export const TopTable = React.memo(function TopTable({
76
76
 
77
77
  const compareMode: boolean = rawcompareMode === undefined ? false : rawcompareMode === 'true';
78
78
 
79
- const dashboardItems = rawDashboardItems as string[];
79
+ const dashboardItems = useMemo(() => {
80
+ if (rawDashboardItems !== undefined) {
81
+ return rawDashboardItems as string[];
82
+ }
83
+ return ['icicle'];
84
+ }, [rawDashboardItems]);
80
85
 
81
86
  const columns = useMemo(() => {
82
87
  const cols: Array<ColumnDef<TopNode, any>> = [