Skip to content

Commit c614f07

Browse files
authored
Update iongraph-web to latest version (#5606)
iongraph now supports passing in line timings, so do that. Also use the migration API.
2 parents 5eed56e + 88ccbb0 commit c614f07

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"escape-string-regexp": "^4.0.0",
8181
"gecko-profiler-demangle": "^0.3.3",
8282
"idb": "^8.0.3",
83-
"iongraph-web": "0.1.4",
83+
"iongraph-web": "0.1.15",
8484
"jszip": "^3.10.1",
8585
"long": "^5.3.2",
8686
"memoize-immutable": "^3.0.0",

src/components/shared/IonGraphView.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
import type { LineTimings } from 'firefox-profiler/types';
55

6-
import { GraphViewer } from 'iongraph-web';
7-
import type { Func } from 'iongraph-web';
6+
import { GraphViewer, migrate } from 'iongraph-web';
87
import 'iongraph-web/dist/style.css';
98

109
import { useMemo } from 'react';
1110

1211
type IonGraphViewProps = {
1312
readonly sourceCode: string;
14-
// TODO: use these when https://github.com/mozilla-spidermonkey/iongraph-web/issues/3 is resolved.
1513
readonly timings: LineTimings;
1614
readonly hotSpotTimings: LineTimings;
1715
};
1816

1917
export function IonGraphView(props: IonGraphViewProps) {
20-
const func = useMemo(() => {
18+
const ionJSON = useMemo(() => {
2119
if (props.sourceCode.trim() === '') {
2220
return null;
2321
}
24-
return JSON.parse(props.sourceCode) as Func;
22+
return migrate(JSON.parse(props.sourceCode));
2523
}, [props.sourceCode]);
2624

27-
if (!func) {
25+
if (!ionJSON?.functions[0]) {
2826
return <div />;
2927
}
30-
return <GraphViewer func={func} />;
28+
return (
29+
<GraphViewer func={ionJSON.functions[0]} sampleCounts={props.timings} />
30+
);
3131
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6421,10 +6421,10 @@ interpret@^3.1.1:
64216421
resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4"
64226422
integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==
64236423

6424-
6425-
version "0.1.4"
6426-
resolved "https://registry.yarnpkg.com/iongraph-web/-/iongraph-web-0.1.4.tgz#ee797db67660f3628d65970374ffb06327c7e122"
6427-
integrity sha512-dH/bBiplFDYWP1WKr8PDPMHY+rQTSyrokGtbqPk2IO0tnCp0zLbXCByJdZiZthqVKjZYzq5V0ouSqW0uijR/6A==
6424+
6425+
version "0.1.15"
6426+
resolved "https://registry.yarnpkg.com/iongraph-web/-/iongraph-web-0.1.15.tgz#8d39240cbfaf476ff7e0f3f14b0301eff33477d7"
6427+
integrity sha512-9QRt32bVk9Uskwb0NYgrrGBo3p7gI2pIuwMgq/ifR3jzyfgKQeICZfngW6GM2Wvivxdxb0y8MxIzJ4Kh3cWZuQ==
64286428

64296429
64306430
version "1.9.1"

0 commit comments

Comments
 (0)