Pauan
Pauan
@cedric-h That crate is equivalent to my code, since `print_error_panic` does display the stack trace. However, `console_error_panic_hook` does add in some workarounds for browser bugs. It would be quite easy...
@JackMordaunt It's defined in stdweb: https://github.com/koute/stdweb/blob/4d337ee9a0a4542ea5803b46b5124d9bc166dcb7/src/webcore/promise_future.rs#L127 Note that you need to enable both the `futures-support` *and* `experimental_features_which_may_break_on_minor_version_bumps` features.
(Also, you can simply switch to a web server which *does* support `application/wasm`, such as [https](https://crates.io/crates/https))
Yeah, I guess it could add in a `.catch` which falls back to `WebAssembly.compile`. That would incur a bit of extra performance loss in the failure case (at least one...
> but this is not good if the file is large. Why isn't it good?
Ah, okay, so you're saying you want it to include the files in the directory, but keep them separate (i.e. not bundle them)?
> (Probably isn't going to happen? I could port the code from cargo-web as a wasm-bindgen PR, but I doubt it'd get accepted.) I can't speak for @alexcrichton, but maybe...
> it would have to work standalone, so either rustc/cargo would have to always start telling the procedural plugins where the target is (e.g. by simply always setting $CARGO_TARGET_DIR), or...
Alternatively, rather than hard-coding in support for Chrome Extensions, cargo-web can instead export a function: ```js "use strict"; if( typeof Rust === "undefined" ) { var Rust = {}; }...
@koute I don't think you would need a gazillion runtimes, since it can export multiple functions: ```js return { loadURL: function ( url ) { if( typeof window === "undefined"...