@parca/profile 0.19.142 → 0.19.144

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 (137) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
  3. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +22 -28
  4. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  5. package/dist/ProfileExplorer/ProfileExplorerCompare.js +72 -73
  6. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
  7. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
  8. package/dist/ProfileFlameChart/index.d.ts.map +1 -1
  9. package/dist/ProfileFlameChart/index.js +20 -24
  10. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
  11. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +13 -14
  12. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  13. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +6 -5
  14. package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
  15. package/dist/ProfileFlameGraph/index.js +8 -7
  16. package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
  17. package/dist/ProfileMetricsGraph/index.js +6 -8
  18. package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
  19. package/dist/ProfileSelector/MetricsGraphSection.js +48 -55
  20. package/dist/ProfileSelector/index.d.ts +1 -1
  21. package/dist/ProfileSelector/index.d.ts.map +1 -1
  22. package/dist/ProfileSelector/index.js +216 -210
  23. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  24. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  25. package/dist/ProfileSelector/useAutoQuerySelector.js +133 -104
  26. package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
  27. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +24 -25
  28. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
  29. package/dist/ProfileView/components/ColorStackLegend.js +3 -5
  30. package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
  31. package/dist/ProfileView/components/InvertCallStack/index.js +47 -47
  32. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +1 -2
  33. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
  34. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +37 -34
  35. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  36. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +282 -294
  37. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
  38. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +7 -8
  39. package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
  40. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
  41. package/dist/ProfileView/components/Toolbars/index.js +1 -1
  42. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
  43. package/dist/ProfileView/components/ViewSelector/index.js +53 -75
  44. package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
  45. package/dist/ProfileView/context/DashboardContext.js +36 -44
  46. package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
  47. package/dist/ProfileView/hooks/useResetFlameGraphState.js +8 -7
  48. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
  49. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +59 -59
  50. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
  51. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +37 -22
  52. package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
  53. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
  54. package/dist/ProfileView/hooks/useVisualizationState.js +116 -147
  55. package/dist/ProfileViewWithData.d.ts.map +1 -1
  56. package/dist/ProfileViewWithData.js +35 -45
  57. package/dist/Sandwich/index.d.ts.map +1 -1
  58. package/dist/Sandwich/index.js +6 -5
  59. package/dist/SourceView/index.d.ts.map +1 -1
  60. package/dist/SourceView/index.js +6 -4
  61. package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
  62. package/dist/SourceView/useSelectedLineRange.js +52 -76
  63. package/dist/Table/MoreDropdown.d.ts.map +1 -1
  64. package/dist/Table/MoreDropdown.js +42 -53
  65. package/dist/Table/TableContextMenu.d.ts.map +1 -1
  66. package/dist/Table/TableContextMenu.js +15 -19
  67. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  68. package/dist/Table/hooks/useTableConfiguration.js +107 -115
  69. package/dist/Table/index.d.ts.map +1 -1
  70. package/dist/Table/index.js +16 -16
  71. package/dist/TopTable/index.d.ts.map +1 -1
  72. package/dist/TopTable/index.js +112 -127
  73. package/dist/hooks/urlParsers.d.ts +18 -0
  74. package/dist/hooks/urlParsers.d.ts.map +1 -0
  75. package/dist/hooks/urlParsers.js +44 -0
  76. package/dist/hooks/useColorBy.d.ts +5 -0
  77. package/dist/hooks/useColorBy.d.ts.map +1 -0
  78. package/dist/hooks/useColorBy.js +63 -0
  79. package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
  80. package/dist/hooks/useCompareModeMeta.js +94 -138
  81. package/dist/hooks/useDashboardItems.d.ts +5 -0
  82. package/dist/hooks/useDashboardItems.d.ts.map +1 -0
  83. package/dist/hooks/useDashboardItems.js +68 -0
  84. package/dist/hooks/useQueryState.d.ts +4 -4
  85. package/dist/hooks/useQueryState.d.ts.map +1 -1
  86. package/dist/hooks/useQueryState.js +127 -122
  87. package/dist/index.d.ts +3 -2
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +3 -12
  90. package/dist/useQuery.js +2 -1
  91. package/dist/useSumBy.d.ts +1 -1
  92. package/dist/useSumBy.d.ts.map +1 -1
  93. package/dist/useSumBy.js +2 -2
  94. package/package.json +4 -3
  95. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +11 -13
  96. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +11 -9
  97. package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
  98. package/src/ProfileFlameChart/index.tsx +21 -28
  99. package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +10 -9
  100. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +5 -3
  101. package/src/ProfileFlameGraph/index.tsx +6 -9
  102. package/src/ProfileMetricsGraph/index.tsx +6 -8
  103. package/src/ProfileSelector/MetricsGraphSection.tsx +5 -10
  104. package/src/ProfileSelector/index.tsx +33 -33
  105. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  106. package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +10 -6
  107. package/src/ProfileView/components/ColorStackLegend.tsx +2 -4
  108. package/src/ProfileView/components/InvertCallStack/index.tsx +5 -4
  109. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +94 -192
  110. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
  111. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +24 -25
  112. package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +4 -5
  113. package/src/ProfileView/components/Toolbars/index.tsx +3 -3
  114. package/src/ProfileView/components/ViewSelector/index.tsx +9 -16
  115. package/src/ProfileView/context/DashboardContext.tsx +6 -6
  116. package/src/ProfileView/hooks/useResetFlameGraphState.ts +6 -4
  117. package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +24 -26
  118. package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +16 -8
  119. package/src/ProfileView/hooks/useVisualizationState.ts +61 -69
  120. package/src/ProfileViewWithData.tsx +29 -35
  121. package/src/Sandwich/index.tsx +4 -3
  122. package/src/SourceView/index.tsx +4 -2
  123. package/src/SourceView/useSelectedLineRange.ts +34 -19
  124. package/src/Table/MoreDropdown.tsx +9 -11
  125. package/src/Table/TableContextMenu.tsx +10 -13
  126. package/src/Table/hooks/useTableConfiguration.tsx +3 -4
  127. package/src/Table/index.tsx +12 -21
  128. package/src/TopTable/index.tsx +3 -4
  129. package/src/hooks/urlParsers.ts +38 -0
  130. package/src/hooks/useColorBy.ts +42 -0
  131. package/src/hooks/useCompareModeMeta.ts +61 -91
  132. package/src/hooks/useDashboardItems.ts +46 -0
  133. package/src/hooks/useQueryState.test.tsx +275 -345
  134. package/src/hooks/useQueryState.ts +153 -120
  135. package/src/index.tsx +16 -15
  136. package/src/useQuery.tsx +1 -1
  137. package/src/useSumBy.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"useProfileFiltersUrlState.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts"],"names":[],"mappings":"AAeA,OAAO,EAAsC,KAAK,sBAAsB,EAAC,MAAM,mBAAmB,CAAC;AAInG,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAsEvD,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,aAAa,EAgDnE,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAO;IAC3C,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,sBAAsB,CAAC,aAAa,EAAE,CAAC,CAAC;IAC3D,iBAAiB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CA4CvD,CAAC"}
1
+ {"version":3,"file":"useProfileFiltersUrlState.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAsEvD,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,aAAa,EAgDnE,CAAC;AAUF,eAAO,MAAM,yBAAyB,QAAO;IAC3C,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACtD,iBAAiB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CAmCvD,CAAC"}
@@ -21,7 +21,7 @@ import { c as _c } from "react-compiler-runtime";
21
21
  // limitations under the License.
22
22
 
23
23
  import { useCallback, useMemo } from 'react';
24
- import { useURLStateBatch, useURLStateCustom } from '@parca/components';
24
+ import { createParser, useQueryState } from 'nuqs';
25
25
  import { safeDecode } from '@parca/utilities';
26
26
  import { isPresetKey } from './filterPresets';
27
27
  // Compact encoding mappings
@@ -144,42 +144,51 @@ export var decodeProfileFilters = function decodeProfileFilters(encoded) {
144
144
  return [];
145
145
  }
146
146
  };
147
+ var profileFiltersParser = createParser({
148
+ parse: function parse(value) {
149
+ return decodeProfileFilters(value);
150
+ },
151
+ serialize: function serialize(value) {
152
+ return encodeProfileFilters(value);
153
+ },
154
+ eq: function eq(a, b) {
155
+ return encodeProfileFilters(a) === encodeProfileFilters(b);
156
+ }
157
+ }).withDefault([]).withOptions({
158
+ history: 'replace'
159
+ });
147
160
  export var useProfileFiltersUrlState = function useProfileFiltersUrlState() {
148
161
  var $ = _c(10);
149
- var batchUpdates = useURLStateBatch();
162
+ var _useQueryState = useQueryState("profile_filters", profileFiltersParser),
163
+ _useQueryState2 = _slicedToArray(_useQueryState, 2),
164
+ appliedFilters = _useQueryState2[0],
165
+ setRawFilters = _useQueryState2[1];
150
166
  var t0;
151
- if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
152
- t0 = {
153
- parse: _temp,
154
- stringify: _temp2,
155
- defaultValue: []
156
- };
157
- $[0] = t0;
167
+ if ($[0] !== appliedFilters) {
168
+ t0 = appliedFilters !== null && appliedFilters !== void 0 ? appliedFilters : [];
169
+ $[0] = appliedFilters;
170
+ $[1] = t0;
158
171
  } else {
159
- t0 = $[0];
172
+ t0 = $[1];
160
173
  }
161
- var _useURLStateCustom = useURLStateCustom("profile_filters", t0),
162
- _useURLStateCustom2 = _slicedToArray(_useURLStateCustom, 2),
163
- appliedFilters = _useURLStateCustom2[0],
164
- setAppliedFilters = _useURLStateCustom2[1];
174
+ var memoizedAppliedFilters = t0;
165
175
  var t1;
166
- if ($[1] !== appliedFilters) {
167
- t1 = appliedFilters !== null && appliedFilters !== void 0 ? appliedFilters : [];
168
- $[1] = appliedFilters;
169
- $[2] = t1;
176
+ if ($[2] !== setRawFilters) {
177
+ t1 = function t1(filters) {
178
+ setRawFilters(filters);
179
+ };
180
+ $[2] = setRawFilters;
181
+ $[3] = t1;
170
182
  } else {
171
- t1 = $[2];
183
+ t1 = $[3];
172
184
  }
173
- var memoizedAppliedFilters = t1;
185
+ var setAppliedFilters = t1;
174
186
  var t2;
175
- if ($[3] !== batchUpdates || $[4] !== setAppliedFilters) {
176
- t2 = function t2(filters) {
177
- var validFilters = filters.filter(_temp3);
178
- batchUpdates(function () {
179
- setAppliedFilters(validFilters);
180
- });
187
+ if ($[4] !== setAppliedFilters) {
188
+ t2 = function t2(filters_0) {
189
+ var validFilters = filters_0.filter(_temp);
190
+ setAppliedFilters(validFilters);
181
191
  };
182
- $[3] = batchUpdates;
183
192
  $[4] = setAppliedFilters;
184
193
  $[5] = t2;
185
194
  } else {
@@ -202,13 +211,7 @@ export var useProfileFiltersUrlState = function useProfileFiltersUrlState() {
202
211
  }
203
212
  return t3;
204
213
  };
205
- function _temp(value) {
206
- return decodeProfileFilters(value);
207
- }
208
- function _temp2(value_0) {
209
- return encodeProfileFilters(value_0);
210
- }
211
- function _temp3(f) {
214
+ function _temp(f) {
212
215
  if (f.type != null && isPresetKey(f.type)) {
213
216
  return f.value !== "" && f.type != null;
214
217
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MultiLevelDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAQtE,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAmK1C,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAsPzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"MultiLevelDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAQtE,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAoK1C,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAoPzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}