Comments (4)
Ah currently this is just the main way to add methods to an otherwise "bland JsValue
", but internally it's just a JsValue
so I pushed up alexcrichton@fc81d8f which allows interconversion
from wasm-bindgen.
A good question!
This wasn't actually super easy to do before so I've been thinking a bit and have decided to tweak how some functions are accessed exposed. I've now written up an example of how to do this as well!
For now that functionality is only available on master, but I'll publish 0.2 soon with that!
from wasm-bindgen.
Please let me know though if the example is confusing or otherwise needs to be fleshed out more, I'd love to expand it!
from wasm-bindgen.
@alexcrichton That example is quite enough. One doubt though, why can't JsValue
be used instead of a new type of HTMLDocument?
from wasm-bindgen.
Related Issues (20)
- Allow closures to take by reference HOT 2
- Providing a closure as member of a parameter object to pass to an JS function
- How to use static linked C++ library via FFI
- Add support to execute tests in workerd HOT 6
- Rust/C++ Interop
- wasm_bindgen::module is currently only supported with `--target no-modules` and `--target web`
- Unable to resolve version issue HOT 5
- Weak references fails to automatic garbage collect HOT 4
- Schema Version Mismatch Error when Using `cargo leptos watch` in WSL Ubuntu Environment
- export names as they are
- Generated binary crashes with "RuntimeError: memory access out of bounds"
- getter macro inconsistent behavior in Release/Debug builds HOT 3
- Uncaught TypeError: Cannot read properties of undefined (reading 'length')
- After extending web_sys with an IDL, when running` cargo doc --all-features --open` I get an erroneous can't find type error
- Automatic deallocation by `FinalizationRegistry` does not work for fully synchronous code HOT 4
- wasm-bindgen is broken and untested at MSRV (1.57) HOT 1
- Missing WebIDL processing features overview HOT 3
- wasm-audio-worklet example gives tons of warnings and some errors
- Expose synchronous XMLHttpRequest HOT 2
- Exports with `#[wasm_bindgen(js_name = default)]` gets exported as `fn _default`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasm-bindgen.