@parca/profile 0.16.261 → 0.16.262

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.262](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.261...@parca/profile@0.16.262) (2023-09-19)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.261](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.260...@parca/profile@0.16.261) (2023-09-18)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -17,8 +17,7 @@ import { scaleLinear } from 'd3-scale';
17
17
  import SyntaxHighlighter, { createElement } from 'react-syntax-highlighter';
18
18
  import { atomOneDark, atomOneLight } from 'react-syntax-highlighter/dist/esm/styles/hljs';
19
19
  import { Tooltip } from 'react-tooltip';
20
- import { useURLState } from '@parca/components';
21
- import { selectDarkMode, useAppSelector } from '@parca/store';
20
+ import { useParcaContext, useURLState } from '@parca/components';
22
21
  import { useProfileViewContext } from '../ProfileView/ProfileViewContext';
23
22
  import { LineNo } from './LineNo';
24
23
  import { langaugeFromFile } from './lang-detector';
@@ -76,11 +75,11 @@ export const profileAwareRenderer = (cumulative, flat, total, filtered) => {
76
75
  };
77
76
  };
78
77
  export const Highlighter = ({ file, content, renderer }) => {
79
- const isDarkMode = useAppSelector(selectDarkMode);
78
+ const { isDarkMode } = useParcaContext();
80
79
  const language = useMemo(() => langaugeFromFile(file), [file]);
81
80
  return (_jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex gap-2 text-xs", children: [_jsx("div", { className: cx('text-right', charsToWidth(content
82
81
  .split(
83
82
  // prettier-ignore
84
83
  '\n')
85
- .length.toString().length)), children: "Line" }), _jsxs("div", { className: "flex gap-3", children: [_jsx("div", { children: "Cumulative" }), _jsx("div", { children: "Flat" }), _jsx("div", { children: "Source" })] })] }), _jsx("div", { className: "text-xs", children: _jsx(SyntaxHighlighter, { language: language, style: isDarkMode ? atomOneDark : atomOneLight, showLineNumbers: true, renderer: renderer, customStyle: { padding: 0, height: '80vh' }, children: content }) })] }));
84
+ .length.toString().length)), children: "Line" }), _jsxs("div", { className: "flex gap-3", children: [_jsx("div", { children: "Cumulative" }), _jsx("div", { children: "Flat" }), _jsx("div", { children: "Source" })] })] }), _jsx("div", { className: "text-xs", children: _jsx(SyntaxHighlighter, { language: language, style: isDarkMode ? atomOneDark : atomOneLight, showLineNumbers: true, renderer: renderer, customStyle: { padding: 0, height: '90vh' }, children: content }) })] }));
86
85
  };
package/dist/useQuery.js CHANGED
@@ -23,8 +23,8 @@ export const useQuery = (client, profileSource, reportType, options) => {
23
23
  options?.nodeTrimThreshold,
24
24
  options?.groupBy,
25
25
  options?.sourceBuildID,
26
- options?.sourceFilename,
27
26
  options?.sourceOnly,
27
+ options?.sourceOnly === true ? '' : options?.sourceFilename,
28
28
  ],
29
29
  queryFn: async () => {
30
30
  const req = profileSource.QueryRequest();
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.261",
3
+ "version": "0.16.262",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@parca/client": "^0.16.87",
7
- "@parca/components": "^0.16.197",
7
+ "@parca/components": "^0.16.198",
8
8
  "@parca/dynamicsize": "^0.16.54",
9
9
  "@parca/hooks": "^0.0.24",
10
10
  "@parca/parser": "^0.16.55",
@@ -49,5 +49,5 @@
49
49
  "access": "public",
50
50
  "registry": "https://registry.npmjs.org/"
51
51
  },
52
- "gitHead": "5f92957a5d928d98b4fe7bec67e5b44e10e380b2"
52
+ "gitHead": "56bb9727a31569c0c5271a053952c5bec4f49b46"
53
53
  }
@@ -20,8 +20,7 @@ import SyntaxHighlighter, {createElement, type createElementProps} from 'react-s
20
20
  import {atomOneDark, atomOneLight} from 'react-syntax-highlighter/dist/esm/styles/hljs';
21
21
  import {Tooltip} from 'react-tooltip';
22
22
 
23
- import {useURLState} from '@parca/components';
24
- import {selectDarkMode, useAppSelector} from '@parca/store';
23
+ import {useParcaContext, useURLState} from '@parca/components';
25
24
 
26
25
  import {useProfileViewContext} from '../ProfileView/ProfileViewContext';
27
26
  import {LineNo} from './LineNo';
@@ -170,7 +169,7 @@ export const profileAwareRenderer = (
170
169
  };
171
170
 
172
171
  export const Highlighter = ({file, content, renderer}: HighlighterProps): JSX.Element => {
173
- const isDarkMode = useAppSelector(selectDarkMode);
172
+ const {isDarkMode} = useParcaContext();
174
173
  const language = useMemo(() => langaugeFromFile(file), [file]);
175
174
 
176
175
  return (
@@ -203,7 +202,7 @@ export const Highlighter = ({file, content, renderer}: HighlighterProps): JSX.El
203
202
  style={isDarkMode ? atomOneDark : atomOneLight}
204
203
  showLineNumbers
205
204
  renderer={renderer}
206
- customStyle={{padding: 0, height: '80vh'}}
205
+ customStyle={{padding: 0, height: '90vh'}}
207
206
  >
208
207
  {content}
209
208
  </SyntaxHighlighter>
package/src/useQuery.tsx CHANGED
@@ -50,8 +50,8 @@ export const useQuery = (
50
50
  options?.nodeTrimThreshold,
51
51
  options?.groupBy,
52
52
  options?.sourceBuildID,
53
- options?.sourceFilename,
54
53
  options?.sourceOnly,
54
+ options?.sourceOnly === true ? '' : options?.sourceFilename,
55
55
  ],
56
56
  queryFn: async () => {
57
57
  const req = profileSource.QueryRequest();