Replies: 1 comment 3 replies
-
Need it! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is the new or updated feature that you are suggesting?
There is currently no way to load Wasm files in a idiomatic way in Remix. You can use workarounds like copying the
.wasm
to the public folder and calling fetch on it within a useEffect. But this is not great DX, nor does it work serverside.Current Workaround method:
With the ESBuild wasm loader plugin added I believe the api could look like this
This obviously requires a top level await since Wasm loads asynchronously but thats what's so great about Remix! The component can Suspend while the wasm is loading.
Why should this feature be included?
Wasm is a well supported web standard thats being used more and more. Devs will need to use wasm in Remix applications. They are either going to add it in a hacky way like I did 🥸 or Remix could add support for it and provide amazing DX
Beta Was this translation helpful? Give feedback.
All reactions