Open kud1ing opened 5 years ago
Note:
hello_world
directory included the index.html
already[Error] Origin null is not allowed by Access-Control-Allow-Origin.
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. (hello_world.js, line 0)
[Error] TypeError: Cross-origin script load denied by Cross-Origin Resource Sharing policy.
promiseReactionJob
This is pretty close to what we already have here: https://rustwasm.github.io/docs/book/game-of-life/hello-world.html
The main difference is that it doesn't use --target web
, but we would like it to eventually. The main thing blocking switching the tutorial to using --target web
is the addition of watch
and serve
subcommands to wasm-pack
, so that we don't regress dev server and file watching fromt he developer experience.
Since we don't have an issue open in the book repo to track this, I'll make this issue be that.
I appreciate this, OTOH:
wasm-bindgen
.I am not a newcomer to Rust, but i've struggled for about 1 hour to figure out how to get the current "hello world" working without installing tools i don't understand the need for.
It' s subjective. I prefer to learn bottom up, from the simple towards the complex.
I've just noticed that there are some more minimal examples:
Suggested instructions that don't need a generator or a bundler:
wasm-pack
is installedexamples/hello_world/
wasm-pack build --target web
create an
index.html
likeindex.html
in a browser