Skip to content

Commit 72f6d0c

Browse files
authored
Merge pull request #156 from microsoft/connor4312/heap-snapshots
feat: support heap snapshots
2 parents 7628451 + e566666 commit 72f6d0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1741
-228
lines changed

package-lock.json

Lines changed: 116 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vscode-js-profile-core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"watch:css": "npm run compile:css && chokidar \"src/**/*.css\" -c \"cpy --parents --cwd=src '**/*.css' ../out/esm\""
1515
},
1616
"dependencies": {
17-
"@vscode/codicons": "^0.0.35"
17+
"@vscode/codicons": "^0.0.35",
18+
"@vscode/v8-heap-parser": "^0.1.0"
1819
}
1920
}

packages/vscode-js-profile-core/src/client/filter.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
44

5-
import { h, FunctionComponent, ComponentChild } from 'preact';
5+
import { ComponentChild, FunctionComponent, h } from 'preact';
66
import { useCallback } from 'preact/hooks';
77
import styles from './filter.css';
88

@@ -11,10 +11,12 @@ import styles from './filter.css';
1111
*/
1212
export const Filter: FunctionComponent<{
1313
value: string;
14+
type?: string;
15+
min?: number;
1416
onChange: (value: string) => void;
1517
placeholder?: string;
1618
foot?: ComponentChild;
17-
}> = ({ value, onChange, placeholder = 'Filter for function', foot }) => {
19+
}> = ({ value, min, type, onChange, placeholder = 'Filter for function', foot }) => {
1820
const onChangeRaw = useCallback(
1921
(evt: Event) => {
2022
onChange((evt.target as HTMLInputElement).value);
@@ -24,7 +26,14 @@ export const Filter: FunctionComponent<{
2426

2527
return (
2628
<div className={styles.wrapper}>
27-
<input value={value} placeholder={placeholder} onPaste={onChangeRaw} onKeyUp={onChangeRaw} />
29+
<input
30+
type={type}
31+
min={min}
32+
value={value}
33+
placeholder={placeholder}
34+
onPaste={onChangeRaw}
35+
onKeyUp={onChangeRaw}
36+
/>
2837
{foot}
2938
</div>
3039
);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*---------------------------------------------------------
2+
* Copyright (C) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------*/
4+
5+
import { FunctionComponent, h } from 'preact';
6+
import styles from './filterBar.css';
7+
8+
export const FilterBar: FunctionComponent = ({ children }) => (
9+
<div className={styles.f}>{children}</div>
10+
);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.progress {
2+
position: absolute;
3+
top: 0;
4+
left: 0;
5+
right: 0;
6+
height: 2px;
7+
pointer-events: none;
8+
overflow: hidden;
9+
z-index: 1;
10+
}
11+
12+
.progress::before {
13+
content: "";
14+
position: absolute;
15+
inset: 0;
16+
width: 2%;
17+
animation-name: progress;
18+
animation-duration: 4s;
19+
animation-iteration-count: infinite;
20+
animation-timing-function: linear;
21+
transform: translate3d(0px, 0px, 0px);
22+
background: var(--vscode-progressBar-background);
23+
}
24+
25+
@keyframes progress {
26+
from { transform: translateX(0%) scaleX(1) }
27+
50% { transform: translateX(2500%) scaleX(3) }
28+
to { transform: translateX(4900%) scaleX(1) }
29+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*---------------------------------------------------------
2+
* Copyright (C) Microsoft Corporation. All rights reserved.
3+
*--------------------------------------------------------*/
4+
5+
import { FunctionComponent, h } from 'preact';
6+
import style from './pageLoader.css';
7+
8+
export const PageLoader: FunctionComponent = () => <div className={style.progress} />;

packages/vscode-js-profile-core/src/client/rich-filter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ComponentChild, Fragment, FunctionComponent, h } from 'preact';
88
import { useEffect, useState } from 'preact/hooks';
99
import { IDataSource, IQueryResults, evaluate } from '../ql';
1010
import { Filter } from './filter';
11+
import { FilterBar } from './filterBar';
1112
import styles from './rich-filter.css';
1213
import { ToggleButton } from './toggle-button';
1314
import { usePersistedState } from './usePersistedState';
@@ -70,7 +71,7 @@ export const richFilter =
7071
}, [regex, caseSensitive, text, data]);
7172

7273
return (
73-
<div className={styles.f}>
74+
<FilterBar>
7475
<Filter
7576
value={text}
7677
placeholder={placeholder}
@@ -94,6 +95,6 @@ export const richFilter =
9495
/>
9596
{error && <div className={styles.error}>{error}</div>}
9697
{foot}
97-
</div>
98+
</FilterBar>
9899
);
99100
};

packages/vscode-js-profile-core/src/client/vscodeApi.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ export interface IVscodeApi<T = unknown> {
1515

1616
declare const acquireVsCodeApi: () => IVscodeApi;
1717

18+
export const vscodeApi = acquireVsCodeApi();
19+
1820
/**
1921
* Context key for the VS Code API object.
2022
*/
21-
export const VsCodeApi = createContext(acquireVsCodeApi());
23+
export const VsCodeApi = createContext(vscodeApi);
2224

2325
/**
2426
* Parses the vscode CSS variables from the document.

0 commit comments

Comments
 (0)