@parca/profile 0.19.140 → 0.19.143

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.
Files changed (182) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +94 -68
  9. package/dist/MatchersInput/SuggestionItem.js +91 -12
  10. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  11. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  12. package/dist/MatchersInput/SuggestionsList.js +371 -157
  13. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  15. package/dist/MatchersInput/index.js +308 -115
  16. package/dist/MetricsCircle/index.js +39 -3
  17. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  18. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  19. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  20. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  21. package/dist/MetricsGraph/index.js +552 -203
  22. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  23. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  24. package/dist/MetricsSeries/index.js +70 -7
  25. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  26. package/dist/PreSelectedMatchers/index.js +249 -102
  27. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -45
  29. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  30. package/dist/ProfileExplorer/index.js +183 -32
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  33. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  34. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  35. package/dist/ProfileFlameChart/index.js +260 -126
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +283 -85
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  56. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  57. package/dist/ProfileFlameGraph/index.js +322 -147
  58. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  59. package/dist/ProfileMetricsGraph/index.js +515 -256
  60. package/dist/ProfileSelector/CompareButton.js +132 -12
  61. package/dist/ProfileSelector/MetricsGraphSection.js +228 -63
  62. package/dist/ProfileSelector/index.d.ts +1 -1
  63. package/dist/ProfileSelector/index.d.ts.map +1 -1
  64. package/dist/ProfileSelector/index.js +734 -142
  65. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  66. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  67. package/dist/ProfileSelector/useAutoQuerySelector.js +280 -132
  68. package/dist/ProfileSource.js +230 -163
  69. package/dist/ProfileTypeSelector/index.js +214 -125
  70. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  71. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +137 -32
  72. package/dist/ProfileView/components/ColorStackLegend.js +182 -54
  73. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  74. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  75. package/dist/ProfileView/components/DiffLegend.js +172 -29
  76. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  77. package/dist/ProfileView/components/InvertCallStack/index.js +97 -9
  78. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  79. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  80. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  81. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +191 -118
  82. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  83. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  84. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  85. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  86. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +664 -192
  87. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  88. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +196 -155
  89. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  90. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  91. package/dist/ProfileView/components/ViewSelector/index.js +186 -82
  92. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  93. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  94. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  95. package/dist/ProfileView/context/DashboardContext.js +74 -26
  96. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  97. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  98. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  99. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  100. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  101. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +53 -17
  102. package/dist/ProfileView/hooks/useVisualizationState.js +229 -69
  103. package/dist/ProfileView/index.js +383 -45
  104. package/dist/ProfileView/types/visualization.js +1 -13
  105. package/dist/ProfileView/utils/colorUtils.js +8 -7
  106. package/dist/ProfileViewWithData.js +319 -225
  107. package/dist/QueryControls/index.js +418 -47
  108. package/dist/Sandwich/components/CalleesSection.js +54 -4
  109. package/dist/Sandwich/components/CallersSection.js +97 -27
  110. package/dist/Sandwich/components/TableSection.js +77 -4
  111. package/dist/Sandwich/index.js +125 -12
  112. package/dist/Sandwich/utils/processRowData.js +48 -39
  113. package/dist/SelectWithRefresh/index.js +102 -28
  114. package/dist/SimpleMatchers/Select.js +520 -187
  115. package/dist/SimpleMatchers/index.js +590 -288
  116. package/dist/SourceView/Highlighter.js +230 -70
  117. package/dist/SourceView/LineNo.js +72 -17
  118. package/dist/SourceView/index.js +177 -101
  119. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  120. package/dist/SourceView/lang-detector/index.js +28 -14
  121. package/dist/SourceView/useSelectedLineRange.js +72 -20
  122. package/dist/Table/ColorCell.js +42 -1
  123. package/dist/Table/ColumnsVisibility.js +114 -6
  124. package/dist/Table/MoreDropdown.js +107 -21
  125. package/dist/Table/TableContextMenu.js +144 -134
  126. package/dist/Table/TableContextMenuWrapper.js +59 -14
  127. package/dist/Table/hooks/useColorManagement.js +58 -16
  128. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  129. package/dist/Table/hooks/useTableConfiguration.js +323 -167
  130. package/dist/Table/index.js +217 -123
  131. package/dist/Table/utils/functions.js +169 -144
  132. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  133. package/dist/TimelineGuide/index.js +209 -16
  134. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  135. package/dist/TopTable/index.js +325 -121
  136. package/dist/contexts/LabelsQueryProvider.js +94 -32
  137. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  138. package/dist/contexts/utils.js +37 -15
  139. package/dist/hooks/urlParsers.js +27 -15
  140. package/dist/hooks/useColorBy.js +47 -10
  141. package/dist/hooks/useCompareModeMeta.js +112 -62
  142. package/dist/hooks/useDashboardItems.js +52 -11
  143. package/dist/hooks/useLabels.js +295 -52
  144. package/dist/hooks/useQueryState.d.ts +1 -1
  145. package/dist/hooks/useQueryState.d.ts.map +1 -1
  146. package/dist/hooks/useQueryState.js +375 -329
  147. package/dist/index.js +11 -6
  148. package/dist/testdata/fg-diff.json +3750 -0
  149. package/dist/testdata/fg-simple.json +1879 -0
  150. package/dist/testdata/link_data.json +56 -0
  151. package/dist/testdata/tabular.json +30 -0
  152. package/dist/testdata/test_flamegraph.json +26846 -0
  153. package/dist/testdata/test_graph.json +53 -0
  154. package/dist/useDelayedLoader.js +32 -18
  155. package/dist/useGrpcQuery/index.js +71 -11
  156. package/dist/useHasProfileData.js +90 -12
  157. package/dist/useQuery.js +205 -64
  158. package/dist/useSumBy.d.ts.map +1 -1
  159. package/dist/useSumBy.js +294 -138
  160. package/dist/utils.js +62 -30
  161. package/package.json +9 -9
  162. package/src/GraphTooltipArrow/index.tsx +3 -0
  163. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  164. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  165. package/src/MatchersInput/index.tsx +1 -1
  166. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  167. package/src/PreSelectedMatchers/index.tsx +3 -0
  168. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -2
  169. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  170. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  171. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  172. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  173. package/src/ProfileSelector/index.tsx +31 -9
  174. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  175. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  176. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  177. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  178. package/src/hooks/useQueryState.ts +18 -3
  179. package/src/useDelayedLoader.ts +10 -10
  180. package/src/useSumBy.ts +12 -18
  181. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  182. package/dist/hooks/useQueryState.test.js +0 -868
package/dist/useSumBy.js CHANGED
@@ -1,3 +1,16 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
+ import { c as _c } from "react-compiler-runtime";
1
14
  // Copyright 2022 The Parca Authors
2
15
  // Licensed under the Apache License, Version 2.0 (the "License");
3
16
  // you may not use this file except in compliance with the License.
@@ -10,155 +23,298 @@
10
23
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
24
  // See the License for the specific language governing permissions and
12
25
  // limitations under the License.
13
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
26
+
27
+ import { useCallback, useMemo, useState } from 'react';
14
28
  import { useLabelNames } from './hooks/useLabels';
15
- export const DEFAULT_EMPTY_SUM_BY = [];
16
- const getDefaultSumBy = (profile, labels) => {
17
- if (profile === undefined || labels === undefined) {
18
- return undefined;
19
- }
20
- if (!profile.delta) {
21
- return DEFAULT_EMPTY_SUM_BY;
22
- }
23
- if (labels.includes('comm')) {
24
- return ['comm'];
25
- }
26
- if (labels.includes('namespace')) {
27
- return ['namespace'];
28
- }
29
- if (labels.includes('container')) {
30
- return ['container'];
31
- }
29
+ export var DEFAULT_EMPTY_SUM_BY = [];
30
+ var getDefaultSumBy = function getDefaultSumBy(profile, labels) {
31
+ if (profile === undefined || labels === undefined) {
32
32
  return undefined;
33
+ }
34
+ if (!profile.delta) {
35
+ return DEFAULT_EMPTY_SUM_BY;
36
+ }
37
+ if (labels.includes('comm')) {
38
+ return ['comm'];
39
+ }
40
+ if (labels.includes('namespace')) {
41
+ return ['namespace'];
42
+ }
43
+ if (labels.includes('container')) {
44
+ return ['container'];
45
+ }
46
+ return undefined;
33
47
  };
34
- export const useSumBySelection = (profileType, labelNamesLoading, labels, draftSumBy, { defaultValue, } = {}) => {
35
- const [userSelectedSumBy, setUserSelectedSumBy] = useState(profileType != null ? { [profileType.toString()]: defaultValue } : {});
36
- // Update userSelectedSumBy when defaultValue changes (e.g., during navigation)
37
- useEffect(() => {
38
- if (profileType != null && defaultValue !== undefined) {
39
- setUserSelectedSumBy(prev => ({
40
- ...prev,
41
- [profileType.toString()]: defaultValue,
42
- }));
43
- }
44
- }, [profileType, defaultValue]);
45
- const setSumBy = useCallback((sumBy) => {
46
- setUserSelectedSumBy(prev => {
47
- if (profileType == null) {
48
- return prev;
49
- }
50
- return {
51
- ...prev,
52
- [profileType.toString()]: sumBy,
53
- };
54
- });
55
- }, [setUserSelectedSumBy, profileType]);
56
- const { defaultSumBy } = useDefaultSumBy(profileType, labelNamesLoading, labels);
57
- // Store the last valid sumBy value to return during loading
58
- const lastValidSumByRef = useRef(DEFAULT_EMPTY_SUM_BY);
59
- const sumBy = useMemo(() => {
60
- if (labelNamesLoading) {
61
- // For smoother UX, return draftSumBy first if available during loading
62
- // as this must be recently computed with the draft time range labels.
63
- if (draftSumBy !== undefined) {
64
- return draftSumBy;
65
- }
66
- if (lastValidSumByRef.current == null) {
67
- return lastValidSumByRef.current;
68
- }
69
- }
70
- // Prefer non-empty URL default over auto-computed default to avoid a
71
- // one-render race where defaultSumBy overwrites the default value from upstream.
72
- const hasExplicitDefault = defaultValue != null && defaultValue.length > 0;
73
- let result = userSelectedSumBy[profileType?.toString() ?? ''] ??
74
- (hasExplicitDefault ? defaultValue : undefined) ??
75
- defaultSumBy ??
76
- DEFAULT_EMPTY_SUM_BY;
77
- if (profileType?.delta !== true) {
78
- result = DEFAULT_EMPTY_SUM_BY;
79
- }
80
- // Store the computed value for next loading state
81
- lastValidSumByRef.current = result;
82
- return result;
83
- }, [userSelectedSumBy, profileType, defaultSumBy, labelNamesLoading, draftSumBy, defaultValue]);
84
- return [
85
- sumBy,
86
- setSumBy,
87
- {
88
- isLoading: labelNamesLoading,
89
- },
90
- ];
91
- };
92
- export const useDefaultSumBy = (profileType, labelNamesLoading, labels) => {
93
- const defaultSumBy = useMemo(() => {
94
- return getDefaultSumBy(profileType, labels);
95
- }, [profileType, labels]);
96
- return { defaultSumBy, isLoading: labelNamesLoading };
97
- };
98
- const getSumByFromParam = (param) => {
99
- if (param?.length === 0) {
100
- return undefined;
48
+ export var useSumBySelection = function useSumBySelection(profileType, labelNamesLoading, labels, draftSumBy) {
49
+ var _ref = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {},
50
+ defaultValue = _ref.defaultValue;
51
+ var _useState = useState(profileType != null ? _defineProperty({}, profileType.toString(), defaultValue) : {}),
52
+ _useState2 = _slicedToArray(_useState, 2),
53
+ userSelectedSumBy = _useState2[0],
54
+ setUserSelectedSumBy = _useState2[1];
55
+
56
+ // Update userSelectedSumBy when defaultValue changes (e.g., during navigation)
57
+ var _useState3 = useState(profileType),
58
+ _useState4 = _slicedToArray(_useState3, 2),
59
+ prevProfileType = _useState4[0],
60
+ setPrevProfileType = _useState4[1];
61
+ var _useState5 = useState(defaultValue),
62
+ _useState6 = _slicedToArray(_useState5, 2),
63
+ prevDefaultValue = _useState6[0],
64
+ setPrevDefaultValue = _useState6[1];
65
+ if (prevProfileType !== profileType || prevDefaultValue !== defaultValue) {
66
+ setPrevProfileType(profileType);
67
+ setPrevDefaultValue(defaultValue);
68
+ if (profileType != null && defaultValue !== undefined) {
69
+ setUserSelectedSumBy(function (prev) {
70
+ return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, profileType.toString(), defaultValue));
71
+ });
101
72
  }
102
- if (param === '__none__') {
103
- return DEFAULT_EMPTY_SUM_BY;
73
+ }
74
+ var setSumBy = useCallback(function (sumBy) {
75
+ setUserSelectedSumBy(function (prev_0) {
76
+ if (profileType == null) {
77
+ return prev_0;
78
+ }
79
+ return _objectSpread(_objectSpread({}, prev_0), {}, _defineProperty({}, profileType.toString(), sumBy));
80
+ });
81
+ }, [setUserSelectedSumBy, profileType]);
82
+ var _useDefaultSumBy = useDefaultSumBy(profileType, labelNamesLoading, labels),
83
+ defaultSumBy = _useDefaultSumBy.defaultSumBy;
84
+ var sumBy_0 = useMemo(function () {
85
+ var _ref3, _ref4, _userSelectedSumBy, _profileType$toString;
86
+ // For smoother UX, return draftSumBy first if available during loading
87
+ // as this must be recently computed with the draft time range labels.
88
+ if (labelNamesLoading && draftSumBy !== undefined) {
89
+ return draftSumBy;
104
90
  }
105
- if (typeof param === 'string') {
106
- // Handle comma-separated strings (e.g., "comm,node" -> ["comm", "node"])
107
- if (param.includes(',')) {
108
- return param
109
- .split(',')
110
- .map(s => s.trim())
111
- .filter(s => s.length > 0);
112
- }
113
- return [param];
91
+
92
+ // Prefer non-empty URL default over auto-computed default to avoid a
93
+ // one-render race where defaultSumBy overwrites the default value from upstream.
94
+ var hasExplicitDefault = defaultValue != null && defaultValue.length > 0;
95
+ var result = (_ref3 = (_ref4 = (_userSelectedSumBy = userSelectedSumBy[(_profileType$toString = profileType === null || profileType === void 0 ? void 0 : profileType.toString()) !== null && _profileType$toString !== void 0 ? _profileType$toString : '']) !== null && _userSelectedSumBy !== void 0 ? _userSelectedSumBy : hasExplicitDefault ? defaultValue : undefined) !== null && _ref4 !== void 0 ? _ref4 : defaultSumBy) !== null && _ref3 !== void 0 ? _ref3 : DEFAULT_EMPTY_SUM_BY;
96
+ if ((profileType === null || profileType === void 0 ? void 0 : profileType.delta) !== true) {
97
+ result = DEFAULT_EMPTY_SUM_BY;
114
98
  }
115
- return param;
99
+ return result;
100
+ }, [userSelectedSumBy, profileType, defaultSumBy, labelNamesLoading, draftSumBy, defaultValue]);
101
+ return [sumBy_0, setSumBy, {
102
+ isLoading: labelNamesLoading
103
+ }];
116
104
  };
117
- export const useSumByFromParams = (param) => {
118
- const sumBy = useMemo(() => {
119
- return getSumByFromParam(param);
120
- }, [param]);
121
- return sumBy;
105
+ export var useDefaultSumBy = function useDefaultSumBy(profileType, labelNamesLoading, labels) {
106
+ var $ = _c(6);
107
+ var t0;
108
+ if ($[0] !== labels || $[1] !== profileType) {
109
+ t0 = getDefaultSumBy(profileType, labels);
110
+ $[0] = labels;
111
+ $[1] = profileType;
112
+ $[2] = t0;
113
+ } else {
114
+ t0 = $[2];
115
+ }
116
+ var defaultSumBy = t0;
117
+ var t1;
118
+ if ($[3] !== defaultSumBy || $[4] !== labelNamesLoading) {
119
+ t1 = {
120
+ defaultSumBy: defaultSumBy,
121
+ isLoading: labelNamesLoading
122
+ };
123
+ $[3] = defaultSumBy;
124
+ $[4] = labelNamesLoading;
125
+ $[5] = t1;
126
+ } else {
127
+ t1 = $[5];
128
+ }
129
+ return t1;
122
130
  };
123
- export const sumByToParam = (sumBy) => {
124
- if (sumBy === undefined) {
125
- return null;
126
- }
127
- if (sumBy.length === 0) {
128
- return '__none__';
131
+ var getSumByFromParam = function getSumByFromParam(param) {
132
+ if ((param === null || param === void 0 ? void 0 : param.length) === 0) {
133
+ return undefined;
134
+ }
135
+ if (param === '__none__') {
136
+ return DEFAULT_EMPTY_SUM_BY;
137
+ }
138
+ if (typeof param === 'string') {
139
+ // Handle comma-separated strings (e.g., "comm,node" -> ["comm", "node"])
140
+ if (param.includes(',')) {
141
+ return param.split(',').map(function (s) {
142
+ return s.trim();
143
+ }).filter(function (s) {
144
+ return s.length > 0;
145
+ });
129
146
  }
130
- return sumBy.join(',');
147
+ return [param];
148
+ }
149
+ return param;
150
+ };
151
+ export var useSumByFromParams = function useSumByFromParams(param) {
152
+ var $ = _c(2);
153
+ var t0;
154
+ if ($[0] !== param) {
155
+ t0 = getSumByFromParam(param);
156
+ $[0] = param;
157
+ $[1] = t0;
158
+ } else {
159
+ t0 = $[1];
160
+ }
161
+ var sumBy = t0;
162
+ return sumBy;
131
163
  };
164
+ export var sumByToParam = function sumByToParam(sumBy) {
165
+ if (sumBy === undefined) {
166
+ return null;
167
+ }
168
+ if (sumBy.length === 0) {
169
+ return '__none__';
170
+ }
171
+ return sumBy.join(',');
172
+ };
173
+
132
174
  // Combined hook that handles all sumBy logic: fetching labels, computing defaults, and managing selection
133
- export const useSumBy = (queryClient, profileType, timeRange, draftProfileType, draftTimeRange, defaultValue) => {
134
- const { loading: labelNamesLoading, result } = useLabelNames(queryClient, profileType?.toString() ?? '', timeRange.getFromMs(), timeRange.getToMs());
135
- const { draftSumBy, setDraftSumBy, isDraftSumByLoading } = useDraftSumBy(queryClient, draftProfileType, draftTimeRange, defaultValue);
136
- const labels = useMemo(() => {
137
- return result.response?.labelNames === undefined ? [] : result.response.labelNames;
138
- }, [result]);
139
- const [sumBySelection, setSumByInternal, { isLoading }] = useSumBySelection(profileType, labelNamesLoading, labels, draftSumBy, { defaultValue });
140
- return {
141
- sumBy: sumBySelection,
142
- setSumBy: setSumByInternal,
143
- isLoading,
144
- draftSumBy,
145
- setDraftSumBy,
146
- isDraftSumByLoading,
175
+ export var useSumBy = function useSumBy(queryClient, profileType, timeRange, draftProfileType, draftTimeRange, defaultValue) {
176
+ var $ = _c(17);
177
+ var t0;
178
+ if ($[0] !== profileType) {
179
+ var _profileType$toString2;
180
+ t0 = (_profileType$toString2 = profileType === null || profileType === void 0 ? void 0 : profileType.toString()) !== null && _profileType$toString2 !== void 0 ? _profileType$toString2 : "";
181
+ $[0] = profileType;
182
+ $[1] = t0;
183
+ } else {
184
+ t0 = $[1];
185
+ }
186
+ var t1;
187
+ if ($[2] !== timeRange) {
188
+ t1 = timeRange.getFromMs();
189
+ $[2] = timeRange;
190
+ $[3] = t1;
191
+ } else {
192
+ t1 = $[3];
193
+ }
194
+ var t2;
195
+ if ($[4] !== timeRange) {
196
+ t2 = timeRange.getToMs();
197
+ $[4] = timeRange;
198
+ $[5] = t2;
199
+ } else {
200
+ t2 = $[5];
201
+ }
202
+ var _useLabelNames = useLabelNames(queryClient, t0, t1, t2),
203
+ labelNamesLoading = _useLabelNames.loading,
204
+ result = _useLabelNames.result;
205
+ var _useDraftSumBy = useDraftSumBy(queryClient, draftProfileType, draftTimeRange, defaultValue),
206
+ draftSumBy = _useDraftSumBy.draftSumBy,
207
+ setDraftSumBy = _useDraftSumBy.setDraftSumBy,
208
+ isDraftSumByLoading = _useDraftSumBy.isDraftSumByLoading;
209
+ var t3;
210
+ if ($[6] !== result.response) {
211
+ var _result$response;
212
+ t3 = ((_result$response = result.response) === null || _result$response === void 0 ? void 0 : _result$response.labelNames) === undefined ? [] : result.response.labelNames;
213
+ $[6] = result.response;
214
+ $[7] = t3;
215
+ } else {
216
+ t3 = $[7];
217
+ }
218
+ var labels = t3;
219
+ var t4;
220
+ if ($[8] !== defaultValue) {
221
+ t4 = {
222
+ defaultValue: defaultValue
147
223
  };
148
- };
149
- export const useDraftSumBy = (queryClient, profileType, timeRange, defaultValue) => {
150
- const [draftSumBy, setDraftSumBy] = useState(defaultValue);
151
- const { loading: labelNamesLoading, result } = useLabelNames(queryClient, profileType?.toString() ?? '', timeRange.getFromMs(), timeRange.getToMs());
152
- const labels = useMemo(() => {
153
- return result.response?.labelNames === undefined ? [] : result.response.labelNames;
154
- }, [result]);
155
- const { defaultSumBy, isLoading } = useDefaultSumBy(profileType, labelNamesLoading, labels);
156
- return {
157
- draftSumBy: draftSumBy ??
158
- (defaultValue != null && defaultValue.length > 0 ? defaultValue : undefined) ??
159
- defaultSumBy ??
160
- DEFAULT_EMPTY_SUM_BY,
161
- setDraftSumBy,
162
- isDraftSumByLoading: isLoading,
224
+ $[8] = defaultValue;
225
+ $[9] = t4;
226
+ } else {
227
+ t4 = $[9];
228
+ }
229
+ var _useSumBySelection = useSumBySelection(profileType, labelNamesLoading, labels, draftSumBy, t4),
230
+ _useSumBySelection2 = _slicedToArray(_useSumBySelection, 3),
231
+ sumBySelection = _useSumBySelection2[0],
232
+ setSumByInternal = _useSumBySelection2[1],
233
+ t5 = _useSumBySelection2[2];
234
+ var isLoading = t5.isLoading;
235
+ var t6;
236
+ if ($[10] !== draftSumBy || $[11] !== isDraftSumByLoading || $[12] !== isLoading || $[13] !== setDraftSumBy || $[14] !== setSumByInternal || $[15] !== sumBySelection) {
237
+ t6 = {
238
+ sumBy: sumBySelection,
239
+ setSumBy: setSumByInternal,
240
+ isLoading: isLoading,
241
+ draftSumBy: draftSumBy,
242
+ setDraftSumBy: setDraftSumBy,
243
+ isDraftSumByLoading: isDraftSumByLoading
163
244
  };
245
+ $[10] = draftSumBy;
246
+ $[11] = isDraftSumByLoading;
247
+ $[12] = isLoading;
248
+ $[13] = setDraftSumBy;
249
+ $[14] = setSumByInternal;
250
+ $[15] = sumBySelection;
251
+ $[16] = t6;
252
+ } else {
253
+ t6 = $[16];
254
+ }
255
+ return t6;
164
256
  };
257
+ export var useDraftSumBy = function useDraftSumBy(queryClient, profileType, timeRange, defaultValue) {
258
+ var _ref5, _ref6;
259
+ var $ = _c(11);
260
+ var _useState7 = useState(defaultValue),
261
+ _useState8 = _slicedToArray(_useState7, 2),
262
+ draftSumBy = _useState8[0],
263
+ setDraftSumBy = _useState8[1];
264
+ var t0;
265
+ if ($[0] !== profileType) {
266
+ var _profileType$toString3;
267
+ t0 = (_profileType$toString3 = profileType === null || profileType === void 0 ? void 0 : profileType.toString()) !== null && _profileType$toString3 !== void 0 ? _profileType$toString3 : "";
268
+ $[0] = profileType;
269
+ $[1] = t0;
270
+ } else {
271
+ t0 = $[1];
272
+ }
273
+ var t1;
274
+ if ($[2] !== timeRange) {
275
+ t1 = timeRange.getFromMs();
276
+ $[2] = timeRange;
277
+ $[3] = t1;
278
+ } else {
279
+ t1 = $[3];
280
+ }
281
+ var t2;
282
+ if ($[4] !== timeRange) {
283
+ t2 = timeRange.getToMs();
284
+ $[4] = timeRange;
285
+ $[5] = t2;
286
+ } else {
287
+ t2 = $[5];
288
+ }
289
+ var _useLabelNames2 = useLabelNames(queryClient, t0, t1, t2),
290
+ labelNamesLoading = _useLabelNames2.loading,
291
+ result = _useLabelNames2.result;
292
+ var t3;
293
+ if ($[6] !== result.response) {
294
+ var _result$response2;
295
+ t3 = ((_result$response2 = result.response) === null || _result$response2 === void 0 ? void 0 : _result$response2.labelNames) === undefined ? [] : result.response.labelNames;
296
+ $[6] = result.response;
297
+ $[7] = t3;
298
+ } else {
299
+ t3 = $[7];
300
+ }
301
+ var labels = t3;
302
+ var _useDefaultSumBy2 = useDefaultSumBy(profileType, labelNamesLoading, labels),
303
+ defaultSumBy = _useDefaultSumBy2.defaultSumBy,
304
+ isLoading = _useDefaultSumBy2.isLoading;
305
+ var t4 = (_ref5 = (_ref6 = draftSumBy !== null && draftSumBy !== void 0 ? draftSumBy : defaultValue != null && defaultValue.length > 0 ? defaultValue : undefined) !== null && _ref6 !== void 0 ? _ref6 : defaultSumBy) !== null && _ref5 !== void 0 ? _ref5 : DEFAULT_EMPTY_SUM_BY;
306
+ var t5;
307
+ if ($[8] !== isLoading || $[9] !== t4) {
308
+ t5 = {
309
+ draftSumBy: t4,
310
+ setDraftSumBy: setDraftSumBy,
311
+ isDraftSumByLoading: isLoading
312
+ };
313
+ $[8] = isLoading;
314
+ $[9] = t4;
315
+ $[10] = t5;
316
+ } else {
317
+ t5 = $[10];
318
+ }
319
+ return t5;
320
+ };
package/dist/utils.js CHANGED
@@ -1,3 +1,13 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
3
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
10
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1
11
  // Copyright 2022 The Parca Authors
2
12
  // Licensed under the Apache License, Version 2.0 (the "License");
3
13
  // you may not use this file except in compliance with the License.
@@ -10,42 +20,64 @@
10
20
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
21
  // See the License for the specific language governing permissions and
12
22
  // limitations under the License.
23
+
13
24
  import { QueryRequest_ReportType } from '@parca/client';
14
- export const hexifyAddress = (address) => {
15
- if (address == null) {
16
- return '';
17
- }
18
- return `0x${address.toString(16)}`;
25
+ export var hexifyAddress = function hexifyAddress(address) {
26
+ if (address == null) {
27
+ return '';
28
+ }
29
+ return "0x".concat(address.toString(16));
19
30
  };
20
- export const downloadPprof = async (request, queryClient, metadata) => {
21
- const req = {
22
- ...request,
23
- reportType: QueryRequest_ReportType.PPROF,
24
- };
25
- const { response } = await queryClient.query(req, { meta: metadata });
26
- if (response.report.oneofKind !== 'pprof') {
27
- throw new Error(`Expected pprof report, got: ${response.report.oneofKind !== undefined ? response.report.oneofKind : 'undefined'}`);
28
- }
29
- const blob = new Blob([response.report.pprof.slice()], { type: 'application/octet-stream' });
30
- return blob;
31
+ export var downloadPprof = /*#__PURE__*/function () {
32
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(request, queryClient, metadata) {
33
+ var req, _yield$queryClient$qu, response, blob;
34
+ return _regenerator().w(function (_context) {
35
+ while (1) switch (_context.n) {
36
+ case 0:
37
+ req = _objectSpread(_objectSpread({}, request), {}, {
38
+ reportType: QueryRequest_ReportType.PPROF
39
+ });
40
+ _context.n = 1;
41
+ return queryClient.query(req, {
42
+ meta: metadata
43
+ });
44
+ case 1:
45
+ _yield$queryClient$qu = _context.v;
46
+ response = _yield$queryClient$qu.response;
47
+ if (!(response.report.oneofKind !== 'pprof')) {
48
+ _context.n = 2;
49
+ break;
50
+ }
51
+ throw new Error("Expected pprof report, got: ".concat(response.report.oneofKind !== undefined ? response.report.oneofKind : 'undefined'));
52
+ case 2:
53
+ blob = new Blob([response.report.pprof.slice()], {
54
+ type: 'application/octet-stream'
55
+ });
56
+ return _context.a(2, blob);
57
+ }
58
+ }, _callee);
59
+ }));
60
+ return function downloadPprof(_x, _x2, _x3) {
61
+ return _ref.apply(this, arguments);
62
+ };
63
+ }();
64
+ export var truncateString = function truncateString(str, num) {
65
+ if (str.length <= num) {
66
+ return str;
67
+ }
68
+ return str.slice(0, num) + '...';
31
69
  };
32
- export const truncateString = (str, num) => {
33
- if (str.length <= num) {
34
- return str;
35
- }
36
- return str.slice(0, num) + '...';
37
- };
38
- export const truncateStringReverse = (str, num) => {
39
- if (str.length <= num) {
40
- return str;
41
- }
42
- return '...' + str.slice(str.length - num);
70
+ export var truncateStringReverse = function truncateStringReverse(str, num) {
71
+ if (str.length <= num) {
72
+ return str;
73
+ }
74
+ return '...' + str.slice(str.length - num);
43
75
  };
44
76
  /**
45
77
  * Ensures the buffer is 8-byte aligned for Arrow IPC parsing with BigInt support.
46
78
  * Arrow's BigInt64Array/BigUint64Array require 8-byte aligned memory.
47
79
  * If not aligned, creates a copy which will be properly aligned.
48
80
  */
49
- export const alignedUint8Array = (buffer) => {
50
- return buffer.byteOffset % 8 === 0 ? buffer : new Uint8Array(buffer);
51
- };
81
+ export var alignedUint8Array = function alignedUint8Array(buffer) {
82
+ return buffer.byteOffset % 8 === 0 ? buffer : new Uint8Array(buffer);
83
+ };
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.140",
3
+ "version": "0.19.143",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@floating-ui/react": "^0.27.12",
7
7
  "@headlessui/react": "^1.7.19",
8
8
  "@iconify/react": "^4.0.0",
9
- "@parca/client": "0.17.22",
10
- "@parca/components": "0.16.412",
9
+ "@parca/client": "0.17.23",
10
+ "@parca/components": "0.16.415",
11
11
  "@parca/dynamicsize": "0.16.74",
12
- "@parca/hooks": "0.0.123",
13
- "@parca/icons": "0.16.81",
12
+ "@parca/hooks": "0.0.125",
13
+ "@parca/icons": "0.16.82",
14
14
  "@parca/parser": "0.16.88",
15
- "@parca/store": "0.16.206",
15
+ "@parca/store": "0.16.207",
16
16
  "@parca/test-utils": "0.0.22",
17
- "@parca/utilities": "0.0.129",
17
+ "@parca/utilities": "0.0.130",
18
18
  "@popperjs/core": "^2.11.8",
19
19
  "@protobuf-ts/runtime-rpc": "^2.5.0",
20
20
  "@storybook/preview-api": "^8.4.3",
@@ -72,7 +72,7 @@
72
72
  "scripts": {
73
73
  "test": "jest --coverage --config ../../../jest.config.js ./src/*",
74
74
  "prepublish": "pnpm run build",
75
- "build": "tsc && pnpm run compile:styles",
75
+ "build": "babel src --out-dir dist --config-file ../../../babel.react-compiler.cjs --extensions .ts,.tsx --copy-files --no-copy-ignored && tsc --emitDeclarationOnly && pnpm run compile:styles",
76
76
  "build-swc": "swc ./src -d dist --copy-files && pnpm run compile:styles",
77
77
  "watch": "tsc-watch --onCompilationComplete 'pnpm run compile:styles'",
78
78
  "compile:styles": "tailwindcss -o dist/styles.css --minify"
@@ -89,5 +89,5 @@
89
89
  "access": "public",
90
90
  "registry": "https://registry.npmjs.org/"
91
91
  },
92
- "gitHead": "0ba0f2c0c43470e6b3e84e6a63299c42ff91e47b"
92
+ "gitHead": "04513bb1ef009ded310263c5381cbebb004826e0"
93
93
  }
@@ -11,6 +11,8 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
+ /* eslint-disable react-hooks/refs */
15
+
14
16
  import React, {useEffect, useState} from 'react';
15
17
 
16
18
  import {flip, offset, shift, useFloating, type VirtualElement} from '@floating-ui/react';
@@ -39,6 +41,7 @@ function createPositionedVirtualElement(contextElement: Element, x = 0, y = 0):
39
41
  }
40
42
 
41
43
  const GraphTooltip = ({children, contextElement}: GraphTooltipProps): React.JSX.Element => {
44
+ 'use no memo';
42
45
  const [isPositioned, setIsPositioned] = useState(false);
43
46
 
44
47
  const {refs, floatingStyles, update} = useFloating({