Skip to content

Conversation

DrSensor
Copy link
Owner

@DrSensor DrSensor commented Aug 25, 2018

This update is about how to compile/load wasm code asynchronously. Also, it adds the ability to import and call JS function from Rust (wasm) code. The async compile/load exists in case that someone needs to load big .wasm code without blocking the process.

[FYI] just for future references

WebAssembly.Module can be efficiently shared with Workers, and instantiated multiple times. Also, according to this spec, it serves as the basis for dynamic linking. That's mean WebAssembly.Module are basically just like .dll or .so file. If this true then there is also possiility to implement hot-swapping 🤔.

📥 ability to call JS function inside Wasm code

[ci skip]
💔 deprecate `promise` in favor of `async`

[ci skip]
🐀 the use case would be having lifecycle hook in wasm code
@DrSensor DrSensor force-pushed the feature/import-js branch 2 times, most recently from a20f5b9 to 263b2c4 Compare August 25, 2018 10:20
this will dismiss warning:
```console
'buffer' is imported but could not be resolved – treating it as an external dependency
```
🔪 wasm code to big for test, need to enable LTO
❌ smoke test fail! use export {default} instead *
@DrSensor DrSensor merged commit 5e35543 into master Aug 25, 2018
@DrSensor DrSensor deleted the feature/import-js branch August 25, 2018 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant