Skip to content

Commit

Permalink
fix: Import bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Jul 21, 2024
1 parent c1146f5 commit b2c5a92
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
11 changes: 4 additions & 7 deletions lykiadb-playground/app/editor.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
'use client';

// import init, { parse } from "@/pkg/lykiadb_playground";
import Editor from "react-simple-code-editor";
import React, { useEffect } from "react";
import React from "react";
import { highlight, languages } from 'prismjs/components/prism-core';
import 'prismjs/components/prism-clike';
import 'prismjs/components/prism-javascript';
import 'prismjs/themes/prism.css'; //Example style, you can use another
import 'prismjs/themes/prism.css';

const EditorView = () => {
const [code, setCode] = React.useState(
`SELECT * FROM foo;`
);
// await init();
return (
<Editor
value={code}
onValueChange={code => setCode(code)}
onValueChange={(code: string) => setCode(code)}
highlight={
code => {
(code: string) => {
return highlight(code, languages.js)
}
}
Expand Down
13 changes: 11 additions & 2 deletions lykiadb-playground/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ const __dirname = dirname(__filename);
const nextConfig = {
webpack: (config, { isServer }) => {
const experiments = config.experiments || {}
config.experiments = { ...experiments, asyncWebAssembly: true, layers: true }
config.experiments = {
...experiments,
asyncWebAssembly: true,
syncWebAssembly: true,
layers: true
}
config.module.rules.push({
test: /\.wasm$/,
type: "webassembly/async",
})
config.plugins.push(new WasmPackPlugin({
crateDirectory: resolve(__dirname, ".")
crateDirectory: resolve(__dirname, "."),
watchDirectories: [
resolve(__dirname, "../lykiadb-lang/src")
],
extraArgs: "--target web"
}))
return config
},
Expand Down

0 comments on commit b2c5a92

Please sign in to comment.