Skip to content
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

Support for WebIDL modules? #1740

Closed
ghost opened this issue Aug 27, 2019 · 2 comments
Closed

Support for WebIDL modules? #1740

ghost opened this issue Aug 27, 2019 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 27, 2019

Has there been a discussion about what it would take to modify wasm-bindgen-webidl to support potential WebIDL modules (see WICG/kv-storage#68 and the issues mentioned there) or something that would provide similar functionality?

I've been experimenting with making webidls for at least parts of the node and electron apis (because doing it with wasm-bindgen is too much work) but it doesn't seem possible to do properly without namespaced interfaces or modules.

The LegacyNamespace attribute on interfaces could probably be used as a (temporary!) workaround in some cases, but wasm-bindgen-webidl doesn't support it, and adding support for it would require at least some of the same machinery as for modules.

I've been poking around the source for weedle and wasm-bindgen-webidl trying to get an idea for how they work to see if I could make the modifications myself and I think I'm starting to understand what's going on.

It looks like the changes could be extensive though since most of the machinery in first_pass.rs deals with names as &str (potentially within a non-nested namespace) and would need to be generalized to handle qualified names instead.

If there is interest in supporting this functionality now (either through experimental support for parsing webidl modules per the PR, or supporting LegacyNamespace, or some other interface) I'd be willing to try and implement it given some guidance.

@ghost ghost added the question Further information is requested label Aug 27, 2019
@alexcrichton
Copy link
Contributor

AFAIK there hasn't been a lot of discussion around this, but adding support seems reasonable!

FWIW we currently only stabilize stage 3 and beyond web APIs in web-sys but we have a not yet implemented plan to land stage 2 and below APIs in web-sys, so to fully land everything if the proposals here aren't stage 3 yet then that'll also need to be implemented before putting everything in web-sys.

@ghost ghost mentioned this issue Aug 29, 2019
@alexcrichton
Copy link
Contributor

I'm going to close this for now because we can support this in weedle when necessary and otherwise #1950 tracks how we plan to track unstable WebIDL in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant