Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: update initial wasm
Stevene3afad74ce7a
diff --git a/web/src/App.tsx b/web/src/App.tsxindex 56242ce26..35fcb974f 100644--- a/web/src/App.tsx+++ b/web/src/App.tsx@@ -26,11 +26,6 @@ const App = () => {}, [systemStatus.host]);useEffect(() => {- const initialGoWASMExec = async () => {- const go = new window.Go();- const result = await WebAssembly.instantiateStreaming(fetch("/gomark.wasm"), go.importObject);- go.run(result.instance);- };const initialState = async () => {try {await userStore.fetchCurrentUser();@@ -39,7 +34,7 @@ const App = () => {}};- Promise.all([initialGoWASMExec(), initialState()]).then(() => setLoading(false));+ Promise.all([initialState()]).then(() => setLoading(false));}, []);useEffect(() => {diff --git a/web/public/gomark.wasm b/web/src/gomark.wasmsimilarity index 100%rename from web/public/gomark.wasmrename to web/src/gomark.wasmdiff --git a/web/src/main.tsx b/web/src/main.tsxindex 295dec551..db7ffb4c1 100644--- a/web/src/main.tsx+++ b/web/src/main.tsx@@ -5,6 +5,7 @@ import { Provider } from "react-redux";import { RouterProvider } from "react-router-dom";import "./css/global.css";import "./css/tailwind.css";+import wasmUrl from "./gomark.wasm?url";import "./helpers/polyfill";import "./i18n";import "./less/highlight.less";@@ -12,13 +13,20 @@ import router from "./router";import store from "./store";import theme from "./theme";-const container = document.getElementById("root");-const root = createRoot(container as HTMLElement);-root.render(- <Provider store={store}>- <CssVarsProvider theme={theme}>- <RouterProvider router={router} />- <Toaster position="top-right" />- </CssVarsProvider>- </Provider>,-);+(async () => {+ const go = new window.Go();+ const responsePromise = fetch(wasmUrl);+ const { instance } = await WebAssembly.instantiateStreaming(responsePromise, go.importObject);+ go.run(instance);++ const container = document.getElementById("root");+ const root = createRoot(container as HTMLElement);+ root.render(+ <Provider store={store}>+ <CssVarsProvider theme={theme}>+ <RouterProvider router={router} />+ <Toaster position="top-right" />+ </CssVarsProvider>+ </Provider>,+ );+})();