Skip to content

Consider having a flag to enable Reference Types proposal #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
protheory8 opened this issue Aug 4, 2021 · 3 comments
Open

Consider having a flag to enable Reference Types proposal #1047

protheory8 opened this issue Aug 4, 2021 · 3 comments

Comments

@protheory8
Copy link

💡 Feature description

wasm-bindgen has a flag --reference-types that can be used to generate a WebAssembly module that uses post-MVP type externref, however currently there is no way that I'm aware of to enable that flag when using wasm-pack. It would be nice if I could do something like wasm-pack build --reference-types to enable that.

@tiye
Copy link

tiye commented Nov 9, 2021

some updated related on V8: https://v8.dev/blog/v8-release-96

The Reference Types proposal, shipped in V8 v9.6, allows using external references from JavaScript opaquely in WebAssembly modules. The externref (formerly known as anyref) data type provides a secure way of holding a reference to a JavaScript object and is fully integrated with V8's garbage collector.

Few toolchains that already have optional support for reference types are wasm-bindgen for Rust and AssemblyScript.

@hcgaron
Copy link

hcgaron commented Jan 14, 2022

Any update on this? I landed here exactly for the same reason, would love to use the reference types through a CLI arg or api

@protheory8
Copy link
Author

Well it seems like the feature is implemented by #937, but it isn't merged yet.

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

No branches or pull requests

3 participants