@parca/profile 0.17.5 → 0.17.6

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.17.6](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.5...@parca/profile@0.17.6) (2025-06-05)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.17.5](https://github.com/parca-dev/parca/compare/@parca/profile@0.17.4...@parca/profile@0.17.5) (2025-06-03)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAA4B,KAAK,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAQlF,UAAU,oBAAoB;IAC5B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAaD,eAAO,MAAM,sBAAsB,eAAgB,MAAM,GAAG,EAAE,KAAG,MAGhE,CAAC;AAoWF,QAAA,MAAM,eAAe,8CAIlB,oBAAoB,KAAG,GAAG,CAAC,OAkB7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ProfileExplorer/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,oBAAoB;IAC5B,WAAW,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,GAAG,CAAC;IACjB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAaD,eAAO,MAAM,sBAAsB,eAAgB,MAAM,GAAG,EAAE,KAAG,MAGhE,CAAC;AAmWF,QAAA,MAAM,eAAe,8CAIlB,oBAAoB,KAAG,GAAG,CAAC,OAkB7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -15,7 +15,7 @@ import { useEffect, useMemo, useState } from 'react';
15
15
  import { Provider } from 'react-redux';
16
16
  import { DateTimeRange, KeyDownProvider, useParcaContext } from '@parca/components';
17
17
  import { createStore } from '@parca/store';
18
- import { capitalizeOnlyFirstLetter } from '@parca/utilities';
18
+ import { capitalizeOnlyFirstLetter, decodeMultipleEncodings, isUrlEncoded, } from '@parca/utilities';
19
19
  import { ProfileSelectionFromParams, SuffixParams } from '..';
20
20
  import { useProfileTypes } from '../ProfileSelector';
21
21
  import { sumByToParam, useSumByFromParams } from '../useSumBy';
@@ -55,10 +55,12 @@ const filterSuffix = (o, suffix) => Object.fromEntries(Object.entries(o)
55
55
  .filter(([key]) => !key.endsWith(suffix))
56
56
  .map(([key, value]) => {
57
57
  if (typeof value === 'string') {
58
- return [key, encodeURIComponent(value)];
58
+ // Only encode if not already encoded
59
+ return [key, isUrlEncoded(value) ? value : encodeURIComponent(value)];
59
60
  }
60
61
  if (Array.isArray(value)) {
61
- return [key, value.map(v => encodeURIComponent(v))];
62
+ // Only encode array values if not already encoded
63
+ return [key, value.map(v => (isUrlEncoded(v) ? v : encodeURIComponent(v)))];
62
64
  }
63
65
  return [key, value];
64
66
  }));
@@ -124,14 +126,10 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
124
126
  from_a = sanitizedRange.from_a;
125
127
  to_a = sanitizedRange.to_a;
126
128
  if ((queryParams?.expression_a ?? '') !== '')
127
- queryParams.expression_a = expression_a;
129
+ queryParams.expression_a = decodeMultipleEncodings(expression_a);
128
130
  if ((queryParams?.expression_b ?? '') !== '')
129
- queryParams.expression_b = expression_b;
131
+ queryParams.expression_b = decodeMultipleEncodings(expression_b);
130
132
  const selectProfile = (p, suffix) => {
131
- queryParams.expression_a = encodeURIComponent(queryParams.expression_a);
132
- queryParams.selection_a = encodeURIComponent(queryParams.selection_a);
133
- queryParams.expression_b = encodeURIComponent(queryParams.expression_b);
134
- queryParams.selection_b = encodeURIComponent(queryParams.selection_b);
135
133
  return navigateTo('/', {
136
134
  ...queryParams,
137
135
  ...SuffixParams(p.HistoryParams(), suffix),
@@ -157,7 +155,7 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
157
155
  ? {
158
156
  merge_from_a: q.mergeFrom,
159
157
  merge_to_a: q.mergeTo,
160
- selection_a: encodeURIComponent(q.expression),
158
+ selection_a: q.expression,
161
159
  }
162
160
  : {};
163
161
  return navigateTo('/',
@@ -166,7 +164,7 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
166
164
  filterEmptyParams({
167
165
  ...filterSuffix(queryParams, '_a'),
168
166
  ...{
169
- expression_a: encodeURIComponent(q.expression),
167
+ expression_a: q.expression,
170
168
  from_a: q.from.toString(),
171
169
  to_a: q.to.toString(),
172
170
  time_selection_a: q.timeSelection,
@@ -176,7 +174,6 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
176
174
  }));
177
175
  };
178
176
  const selectProfile = (p) => {
179
- queryParams.expression_a = encodeURIComponent(queryParams.expression_a);
180
177
  return navigateTo('/', {
181
178
  ...queryParams,
182
179
  ...SuffixParams(p.HistoryParams(), '_a'),
@@ -206,9 +203,9 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
206
203
  ...filterSuffix(queryParams, '_a'),
207
204
  ...{
208
205
  compare_a: 'true',
209
- expression_a: encodeURIComponent(q.expression),
210
- expression_b: encodeURIComponent(expression_b),
211
- selection_b: encodeURIComponent(selection_b),
206
+ expression_a: q.expression,
207
+ expression_b,
208
+ selection_b,
212
209
  from_a: q.from.toString(),
213
210
  to_a: q.to.toString(),
214
211
  time_selection_a: q.timeSelection,
@@ -223,7 +220,7 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
223
220
  ? {
224
221
  merge_from_b: q.mergeFrom,
225
222
  merge_to_b: q.mergeTo,
226
- selection_b: encodeURIComponent(q.expression),
223
+ selection_b: q.expression,
227
224
  }
228
225
  : {};
229
226
  return navigateTo('/',
@@ -233,9 +230,9 @@ const ProfileExplorerApp = ({ queryClient, queryParams, navigateTo, }) => {
233
230
  ...filterSuffix(queryParams, '_b'),
234
231
  ...{
235
232
  compare_b: 'true',
236
- expression_b: encodeURIComponent(q.expression),
237
- expression_a: encodeURIComponent(expression_a),
238
- selection_a: encodeURIComponent(selection_a),
233
+ expression_b: q.expression,
234
+ expression_a,
235
+ selection_a,
239
236
  from_b: q.from.toString(),
240
237
  to_b: q.to.toString(),
241
238
  time_selection_b: q.timeSelection,
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.17.5",
3
+ "version": "0.17.6",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
7
7
  "@iconify/react": "^4.0.0",
8
8
  "@parca/client": "0.16.129",
9
- "@parca/components": "0.16.337",
9
+ "@parca/components": "0.16.338",
10
10
  "@parca/dynamicsize": "0.16.65",
11
- "@parca/hooks": "0.0.87",
11
+ "@parca/hooks": "0.0.88",
12
12
  "@parca/icons": "0.16.71",
13
13
  "@parca/parser": "0.16.78",
14
- "@parca/store": "0.16.172",
15
- "@parca/utilities": "0.0.97",
14
+ "@parca/store": "0.16.173",
15
+ "@parca/utilities": "0.0.98",
16
16
  "@popperjs/core": "^2.11.8",
17
17
  "@protobuf-ts/runtime-rpc": "^2.5.0",
18
18
  "@storybook/preview-api": "^8.4.3",
@@ -77,5 +77,5 @@
77
77
  "access": "public",
78
78
  "registry": "https://registry.npmjs.org/"
79
79
  },
80
- "gitHead": "859a26525b61192beea3ed997057e6df3d98ea8d"
80
+ "gitHead": "57a6cd95c786690c9cdd0daaf9206df1bcf8d32e"
81
81
  }
@@ -18,7 +18,12 @@ import {Provider} from 'react-redux';
18
18
  import {QueryServiceClient} from '@parca/client';
19
19
  import {DateTimeRange, KeyDownProvider, useParcaContext} from '@parca/components';
20
20
  import {createStore} from '@parca/store';
21
- import {capitalizeOnlyFirstLetter, type NavigateFunction} from '@parca/utilities';
21
+ import {
22
+ capitalizeOnlyFirstLetter,
23
+ decodeMultipleEncodings,
24
+ isUrlEncoded,
25
+ type NavigateFunction,
26
+ } from '@parca/utilities';
22
27
 
23
28
  import {ProfileSelection, ProfileSelectionFromParams, SuffixParams} from '..';
24
29
  import {QuerySelection, useProfileTypes} from '../ProfileSelector';
@@ -91,10 +96,12 @@ const filterSuffix = (
91
96
  .filter(([key]) => !key.endsWith(suffix))
92
97
  .map(([key, value]) => {
93
98
  if (typeof value === 'string') {
94
- return [key, encodeURIComponent(value)];
99
+ // Only encode if not already encoded
100
+ return [key, isUrlEncoded(value) ? value : encodeURIComponent(value)];
95
101
  }
96
102
  if (Array.isArray(value)) {
97
- return [key, value.map(v => encodeURIComponent(v))];
103
+ // Only encode array values if not already encoded
104
+ return [key, value.map(v => (isUrlEncoded(v) ? v : encodeURIComponent(v)))];
98
105
  }
99
106
  return [key, value];
100
107
  })
@@ -220,14 +227,12 @@ const ProfileExplorerApp = ({
220
227
  from_a = sanitizedRange.from_a;
221
228
  to_a = sanitizedRange.to_a;
222
229
 
223
- if ((queryParams?.expression_a ?? '') !== '') queryParams.expression_a = expression_a;
224
- if ((queryParams?.expression_b ?? '') !== '') queryParams.expression_b = expression_b;
230
+ if ((queryParams?.expression_a ?? '') !== '')
231
+ queryParams.expression_a = decodeMultipleEncodings(expression_a);
232
+ if ((queryParams?.expression_b ?? '') !== '')
233
+ queryParams.expression_b = decodeMultipleEncodings(expression_b);
225
234
 
226
235
  const selectProfile = (p: ProfileSelection, suffix: string): void => {
227
- queryParams.expression_a = encodeURIComponent(queryParams.expression_a);
228
- queryParams.selection_a = encodeURIComponent(queryParams.selection_a);
229
- queryParams.expression_b = encodeURIComponent(queryParams.expression_b);
230
- queryParams.selection_b = encodeURIComponent(queryParams.selection_b);
231
236
  return navigateTo('/', {
232
237
  ...queryParams,
233
238
  ...SuffixParams(p.HistoryParams(), suffix),
@@ -258,7 +263,7 @@ const ProfileExplorerApp = ({
258
263
  ? {
259
264
  merge_from_a: q.mergeFrom,
260
265
  merge_to_a: q.mergeTo,
261
- selection_a: encodeURIComponent(q.expression),
266
+ selection_a: q.expression,
262
267
  }
263
268
  : {};
264
269
  return navigateTo(
@@ -268,7 +273,7 @@ const ProfileExplorerApp = ({
268
273
  filterEmptyParams({
269
274
  ...filterSuffix(queryParams, '_a'),
270
275
  ...{
271
- expression_a: encodeURIComponent(q.expression),
276
+ expression_a: q.expression,
272
277
  from_a: q.from.toString(),
273
278
  to_a: q.to.toString(),
274
279
  time_selection_a: q.timeSelection,
@@ -280,7 +285,6 @@ const ProfileExplorerApp = ({
280
285
  };
281
286
 
282
287
  const selectProfile = (p: ProfileSelection): void => {
283
- queryParams.expression_a = encodeURIComponent(queryParams.expression_a);
284
288
  return navigateTo('/', {
285
289
  ...queryParams,
286
290
  ...SuffixParams(p.HistoryParams(), '_a'),
@@ -324,9 +328,9 @@ const ProfileExplorerApp = ({
324
328
  ...filterSuffix(queryParams, '_a'),
325
329
  ...{
326
330
  compare_a: 'true',
327
- expression_a: encodeURIComponent(q.expression),
328
- expression_b: encodeURIComponent(expression_b),
329
- selection_b: encodeURIComponent(selection_b),
331
+ expression_a: q.expression,
332
+ expression_b,
333
+ selection_b,
330
334
  from_a: q.from.toString(),
331
335
  to_a: q.to.toString(),
332
336
  time_selection_a: q.timeSelection,
@@ -344,7 +348,7 @@ const ProfileExplorerApp = ({
344
348
  ? {
345
349
  merge_from_b: q.mergeFrom,
346
350
  merge_to_b: q.mergeTo,
347
- selection_b: encodeURIComponent(q.expression),
351
+ selection_b: q.expression,
348
352
  }
349
353
  : {};
350
354
  return navigateTo(
@@ -355,9 +359,9 @@ const ProfileExplorerApp = ({
355
359
  ...filterSuffix(queryParams, '_b'),
356
360
  ...{
357
361
  compare_b: 'true',
358
- expression_b: encodeURIComponent(q.expression),
359
- expression_a: encodeURIComponent(expression_a),
360
- selection_a: encodeURIComponent(selection_a),
362
+ expression_b: q.expression,
363
+ expression_a,
364
+ selection_a,
361
365
  from_b: q.from.toString(),
362
366
  to_b: q.to.toString(),
363
367
  time_selection_b: q.timeSelection,