-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide .js build with --target web that works in simple .html file. #63
Comments
I have now tried to build for the web on binder. But unfortunately it is not bundled (I believe) so it raises all kinds of import errors in the browser console for 'vega', 'vega-util', 'vega-tooltip' and 'loadash'. My steps where curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/en
rustup update
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
git clone https://github.com/vegafusion/vegafusion.git
cd vegafusion
cd vegafusion-wasm
wasm-pack build --target web --dev # add --release if ready for it |
I would like to get to a place something like this would work (or I can <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple template</title>
</head>
<script type="module">
import { render_vegafusion } from "./some_file.js"
console.log("hello world")
</script>
<body>
</body>
</html> Feel free to replace "./some_file.js" with a url. But I need something self contained and well described. For now I have to give up on #62. I need help from someone who is more capable than I am in this environment. |
I got to a place where I could manually replace and serve the index.html file on a simple web server. It almost worked but failed on |
Ok. A starting point is this code sandbox. Here I seem to be able to import and use |
Hi Marc, In case it helps, here is the resulting directory I get when building with
from the |
I believe a lot of the struggles I'm having in #62 could be avoided if I could have accessed a
js
file targetted for the web.See https://stackoverflow.com/questions/64308461/failed-to-load-wasm-application
(I'm not sure because the world of rust, wasm etc. is not familiar to me. So I'm walking around like a blind here. I don't yet understand the terminologi).
The text was updated successfully, but these errors were encountered: