From 5a36b130919e5028509c96c1a48e7700dc1858c0 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Wed, 28 Dec 2022 19:13:49 +0100 Subject: [PATCH] fix(frontend): migrate to new wasm loading method Signed-off-by: Tilman Vatteroth --- frontend/next.config.js | 3 --- .../extra-integrations/graphviz/graphviz-frame.tsx | 10 +--------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index 13badad4a..9db1b1f3a 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -58,14 +58,11 @@ const rawNextConfig = { ] }) - const wasmModulePath = path.dirname(require.resolve('@hpcc-js/wasm')) const emojiPickerDataModulePath = path.dirname(require.resolve('emoji-picker-element-data/en/emojibase/data.json')) config.plugins.push( new CopyWebpackPlugin({ patterns: [ - { from: path.join(wasmModulePath, 'graphvizlib.wasm'), to: 'static/js' }, - { from: path.join(wasmModulePath, 'expatlib.wasm'), to: 'static/js' }, { from: emojiPickerDataModulePath, to: 'static/js/emoji-data.json' diff --git a/frontend/src/extensions/extra-integrations/graphviz/graphviz-frame.tsx b/frontend/src/extensions/extra-integrations/graphviz/graphviz-frame.tsx index 37c88bba0..d0b03c130 100644 --- a/frontend/src/extensions/extra-integrations/graphviz/graphviz-frame.tsx +++ b/frontend/src/extensions/extra-integrations/graphviz/graphviz-frame.tsx @@ -30,15 +30,7 @@ export const GraphvizFrame: React.FC = ({ code }) => { value: graphvizImport, error: libLoadingError, loading: isLibLoading - } = useAsync( - async () => - import(/* webpackChunkName: "d3-graphviz" */ '@hpcc-js/wasm') - .then((wasmPlugin) => { - wasmPlugin.wasmFolder(`${basePath}/_next/static/js`) - }) - .then(() => import(/* webpackChunkName: "d3-graphviz" */ 'd3-graphviz')), - [] - ) + } = useAsync(() => import(/* webpackChunkName: "d3-graphviz" */ 'd3-graphviz'), []) const showError = useCallback((error: string) => { if (!container.current) {