Pauan

Results 1228 comments of Pauan

Well, whatever you decide for the manual runtime, it should support [`WebAssembly.instantiateStreaming`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/WebAssembly/instantiateStreaming) (since that's the most efficient way to load wasm). Maybe something like this: ```js WebAssembly.instantiateStreaming( fetch(chrome.runtime.getURL("saltybet.wasm")), Rust.saltybet.imports ).then((x)...

@madmaxio This issue has already been fixed: you can use `--runtime web-extension` to compile for Chrome/Firefox/Edge/Opera extensions. If you need more control, you can instead use `--runtime library-es6` and then...

@madmaxio I don't think so. You'll have to use `--runtime library-es6` and then handle the loading yourself: ```js import factory from "./path/to/my-module.js"; const url = "./path/to/my-module.wasm"; const instance = factory();...

(Personally, I agree that there should be some sort of `Web.toml` flag to customize the folder/URL for the standalone runtime. It's a common need. And other bundlers like Webpack allow...

I understand the concern about external dependencies. In this particular case UglifyJS is cross-platform, since it runs on Node. As an alternative, if cargo-web can get excellent support for Webpack...

@anlumo Minifiers don't change behavior, so you should absolutely *not* be getting any errors. What minifier did you use?

@anlumo Well, that sounds like a bug in Babel, then! If you want, you can try creating a reduced test case and submitting it to the Babel team, but that's...

@koute I think `--runtime` should work with `deploy`, because when developing Chrome/Firefox extensions, right now you need to use a build script or manually copy files. But if `cargo web...

> (syn should be able to do it, but I'm not sure if it can easily parse an expression explicitly delimited with a } at the end) Rather than chopping...

@slmjkdbtl To be more specific, you would do something like this: ```js import init from "./path/to/js"; const wasm = init(); WebAssembly.instantiateStreaming(fetch("path/to/wasm"), wasm.imports).then((result) => { const exports = wasm.initialize(result.instance); }); ```