diff --git a/package.json b/package.json index 1513fa862a..c757a19e76 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "escape-string-regexp": "^4.0.0", "gecko-profiler-demangle": "^0.3.3", "idb": "^8.0.3", - "iongraph-web": "0.1.4", + "iongraph-web": "0.1.15", "jszip": "^3.10.1", "long": "^5.3.2", "memoize-immutable": "^3.0.0", diff --git a/src/components/shared/IonGraphView.tsx b/src/components/shared/IonGraphView.tsx index fecaf73c5f..89fb7eb305 100644 --- a/src/components/shared/IonGraphView.tsx +++ b/src/components/shared/IonGraphView.tsx @@ -3,29 +3,29 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import type { LineTimings } from 'firefox-profiler/types'; -import { GraphViewer } from 'iongraph-web'; -import type { Func } from 'iongraph-web'; +import { GraphViewer, migrate } from 'iongraph-web'; import 'iongraph-web/dist/style.css'; import { useMemo } from 'react'; type IonGraphViewProps = { readonly sourceCode: string; - // TODO: use these when https://github.com/mozilla-spidermonkey/iongraph-web/issues/3 is resolved. readonly timings: LineTimings; readonly hotSpotTimings: LineTimings; }; export function IonGraphView(props: IonGraphViewProps) { - const func = useMemo(() => { + const ionJSON = useMemo(() => { if (props.sourceCode.trim() === '') { return null; } - return JSON.parse(props.sourceCode) as Func; + return migrate(JSON.parse(props.sourceCode)); }, [props.sourceCode]); - if (!func) { + if (!ionJSON?.functions[0]) { return
; } - return