@parca/profile 0.19.157 → 0.19.159
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.19.159](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.158...@parca/profile@0.19.159) (2026-06-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
## [0.19.158](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.157...@parca/profile@0.19.158) (2026-06-24)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @parca/profile
|
|
13
|
+
|
|
6
14
|
## [0.19.157](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.156...@parca/profile@0.19.157) (2026-06-23)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryState.d.ts","sourceRoot":"","sources":["../../src/hooks/useQueryState.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,gBAAgB,EAA8B,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAM7F,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,M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,EAAE,MAAM,KAChB,IAAI,CAAC;IAGV,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAG1C,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAGpC,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAGhF,YAAY,EAAE,OAAO,CAAC;IAGtB,gBAAgB,EAAE,KAAK,GAAG,IAAI,CAAC;IAG/B,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;IAE1B,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,aAAa,GAAI,UAAS,oBAAyB,KAAG,mBAydlE,CAAC"}
|
|
@@ -36,7 +36,8 @@ export var useQueryState = function useQueryState() {
|
|
|
36
36
|
var _queryParams$expressi, _queryParams$from, _queryParams$to, _queryParams$time_sel, _ref, _ref2;
|
|
37
37
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38
38
|
var _useParcaContext = useParcaContext(),
|
|
39
|
-
queryClient = _useParcaContext.queryServiceClient
|
|
39
|
+
queryClient = _useParcaContext.queryServiceClient,
|
|
40
|
+
externalProfilerComponent = _useParcaContext.externalProfilerComponent;
|
|
40
41
|
var _options$suffix = options.suffix,
|
|
41
42
|
suffix = _options$suffix === void 0 ? '' : _options$suffix,
|
|
42
43
|
_options$defaultExpre = options.defaultExpression,
|
|
@@ -109,6 +110,12 @@ export var useQueryState = function useQueryState() {
|
|
|
109
110
|
// Parse sumBy from URL parameter format
|
|
110
111
|
var sumBy = useSumByFromParams(sumByParam !== null && sumByParam !== void 0 ? sumByParam : undefined);
|
|
111
112
|
|
|
113
|
+
// Fall back to the externally-provided sumBy default when the URL carries no
|
|
114
|
+
// sum_by, so the materialized value reflects it instead of the empty __none__
|
|
115
|
+
// sentinel (an explicit __none__ from the URL is left untouched).
|
|
116
|
+
var externalSumBy = externalProfilerComponent === null || externalProfilerComponent === void 0 ? void 0 : externalProfilerComponent.defaultSumBy;
|
|
117
|
+
var sumByWithViewDefault = sumBy !== null && sumBy !== void 0 ? sumBy : externalSumBy != null && externalSumBy.length > 0 ? externalSumBy : undefined;
|
|
118
|
+
|
|
112
119
|
// Draft state management
|
|
113
120
|
var _useState = useState(expression !== null && expression !== void 0 ? expression : defaultExpression),
|
|
114
121
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -164,7 +171,7 @@ export var useQueryState = function useQueryState() {
|
|
|
164
171
|
return DateTimeRange.fromRangeKey(draftTimeSelection !== null && draftTimeSelection !== void 0 ? draftTimeSelection : defaultTimeSelection, draftFrom !== '' ? parseInt(draftFrom) : defaultFrom, draftTo !== '' ? parseInt(draftTo) : defaultTo);
|
|
165
172
|
}, [draftTimeSelection, draftFrom, draftTo, defaultTimeSelection, defaultFrom, defaultTo]);
|
|
166
173
|
// Use combined sumBy hook for fetching labels and computing defaults (based on committed state)
|
|
167
|
-
var _useSumBy = useSumBy(queryClient, (profileType === null || profileType === void 0 ? void 0 : profileType.profileName) !== '' ? profileType : draftProfileType, draftTimeRange, draftProfileType, draftTimeRange,
|
|
174
|
+
var _useSumBy = useSumBy(queryClient, (profileType === null || profileType === void 0 ? void 0 : profileType.profileName) !== '' ? profileType : draftProfileType, draftTimeRange, draftProfileType, draftTimeRange, sumByWithViewDefault),
|
|
168
175
|
computedSumByFromURL = _useSumBy.sumBy,
|
|
169
176
|
sumBySelectionLoading = _useSumBy.isLoading,
|
|
170
177
|
draftSumBy = _useSumBy.draftSumBy,
|
|
@@ -193,13 +200,13 @@ export var useQueryState = function useQueryState() {
|
|
|
193
200
|
// Sync computed sumBy to URL if URL doesn't already have a value
|
|
194
201
|
// to ensure the shared URL can always pick it up.
|
|
195
202
|
// Only run once (when sumByParam first becomes available), not on every change,
|
|
196
|
-
// to avoid oscillation with external writers
|
|
203
|
+
// to avoid oscillation with external writers
|
|
197
204
|
var hasSyncedSumByRef = useRef(false);
|
|
198
205
|
useEffect(function () {
|
|
199
206
|
if (sumByParam !== null) {
|
|
200
207
|
hasSyncedSumByRef.current = true;
|
|
201
208
|
}
|
|
202
|
-
if (!hasSyncedSumByRef.current && sumByParam === null && computedSumByFromURL !== undefined && !sumBySelectionLoading) {
|
|
209
|
+
if (!hasSyncedSumByRef.current && sumByParam === null && computedSumByFromURL !== undefined && computedSumByFromURL.length > 0 && !sumBySelectionLoading) {
|
|
203
210
|
hasSyncedSumByRef.current = true;
|
|
204
211
|
void setSumByParam(sumByToParam(computedSumByFromURL));
|
|
205
212
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.159",
|
|
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
9
|
"@parca/client": "0.17.24",
|
|
10
|
-
"@parca/components": "0.16.
|
|
10
|
+
"@parca/components": "0.16.422",
|
|
11
11
|
"@parca/dynamicsize": "0.16.75",
|
|
12
12
|
"@parca/hooks": "0.0.128",
|
|
13
13
|
"@parca/icons": "0.16.83",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"access": "public",
|
|
90
90
|
"registry": "https://registry.npmjs.org/"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "fb7962c6eb9017aa89f0d0c0c468a8eb2f6d6f54"
|
|
93
93
|
}
|
|
@@ -79,7 +79,7 @@ interface UseQueryStateReturn {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryStateReturn => {
|
|
82
|
-
const {queryServiceClient: queryClient} = useParcaContext();
|
|
82
|
+
const {queryServiceClient: queryClient, externalProfilerComponent} = useParcaContext();
|
|
83
83
|
const {
|
|
84
84
|
suffix = '',
|
|
85
85
|
defaultExpression = '',
|
|
@@ -153,6 +153,13 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
|
|
|
153
153
|
// Parse sumBy from URL parameter format
|
|
154
154
|
const sumBy = useSumByFromParams(sumByParam ?? undefined);
|
|
155
155
|
|
|
156
|
+
// Fall back to the externally-provided sumBy default when the URL carries no
|
|
157
|
+
// sum_by, so the materialized value reflects it instead of the empty __none__
|
|
158
|
+
// sentinel (an explicit __none__ from the URL is left untouched).
|
|
159
|
+
const externalSumBy = externalProfilerComponent?.defaultSumBy;
|
|
160
|
+
const sumByWithViewDefault =
|
|
161
|
+
sumBy ?? (externalSumBy != null && externalSumBy.length > 0 ? externalSumBy : undefined);
|
|
162
|
+
|
|
156
163
|
// Draft state management
|
|
157
164
|
const [draftExpression, setDraftExpression] = useState<string>(expression ?? defaultExpression);
|
|
158
165
|
const [draftFrom, setDraftFrom] = useState<string>(from ?? defaultFrom?.toString() ?? '');
|
|
@@ -209,7 +216,7 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
|
|
|
209
216
|
draftTimeRange,
|
|
210
217
|
draftProfileType,
|
|
211
218
|
draftTimeRange,
|
|
212
|
-
|
|
219
|
+
sumByWithViewDefault
|
|
213
220
|
);
|
|
214
221
|
|
|
215
222
|
// Sync draft state with URL state when URL changes externally
|
|
@@ -236,7 +243,7 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
|
|
|
236
243
|
// Sync computed sumBy to URL if URL doesn't already have a value
|
|
237
244
|
// to ensure the shared URL can always pick it up.
|
|
238
245
|
// Only run once (when sumByParam first becomes available), not on every change,
|
|
239
|
-
// to avoid oscillation with external writers
|
|
246
|
+
// to avoid oscillation with external writers
|
|
240
247
|
const hasSyncedSumByRef = useRef(false);
|
|
241
248
|
useEffect(() => {
|
|
242
249
|
if (sumByParam !== null) {
|
|
@@ -246,6 +253,7 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
|
|
|
246
253
|
!hasSyncedSumByRef.current &&
|
|
247
254
|
sumByParam === null &&
|
|
248
255
|
computedSumByFromURL !== undefined &&
|
|
256
|
+
computedSumByFromURL.length > 0 &&
|
|
249
257
|
!sumBySelectionLoading
|
|
250
258
|
) {
|
|
251
259
|
hasSyncedSumByRef.current = true;
|