Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
e3afad74
Commit
e3afad74
authored
Feb 01, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update initial wasm
parent
554f93ec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
App.tsx
web/src/App.tsx
+1
-6
gomark.wasm
web/src/gomark.wasm
+0
-0
main.tsx
web/src/main.tsx
+18
-10
No files found.
web/src/App.tsx
View file @
e3afad74
...
...
@@ -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
([
initial
GoWASMExec
(),
initial
State
()]).
then
(()
=>
setLoading
(
false
));
Promise
.
all
([
initialState
()]).
then
(()
=>
setLoading
(
false
));
},
[]);
useEffect
(()
=>
{
...
...
web/
publi
c/gomark.wasm
→
web/
sr
c/gomark.wasm
View file @
e3afad74
File moved
web/src/main.tsx
View file @
e3afad74
...
...
@@ -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
(
(
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
>,
);
);
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment