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

Make WASM an opt-in feature #333

Closed
Razican opened this issue Apr 18, 2020 · 5 comments · Fixed by #352
Closed

Make WASM an opt-in feature #333

Razican opened this issue Apr 18, 2020 · 5 comments · Fixed by #352
Labels
good first issue Good for newcomers webassembly Anything related to using Boa with WASM
Milestone

Comments

@Razican
Copy link
Member

Razican commented Apr 18, 2020

Currently, webassembly is an opt-out feature. While we use it for the web example, I think in the future it will be more common for Boa to be used as a library than as webassembly.

In this scenario, I think it's best to make the feature opt-in, so that we don't need to use default-features = false when loading the crate as a library.

This would mean that we need somehow to be able to select a feature in wasm-pack, or that we need a different crate only exporting boa as wasm, in the workspace, something like boa-wasm.

I would go for this second option, as it also allows us to add #![forbid(unsafe_code)] at the crate level in boa.

What do you think?

@Razican Razican added the webassembly Anything related to using Boa with WASM label Apr 18, 2020
@HalidOdat
Copy link
Member

HalidOdat commented Apr 18, 2020

This would mean that we need somehow to be able to select a feature in wasm-pack, or that we need a different crate only exporting boa as wasm, in the workspace, something like boa-wasm.

I also think this is a good idea as it would allow us to move the most of the webassembly stuff in that directory, making things more organized.

And not having to specify that the default-features = false is awesome as the default features should be features that every one needs by default.

@jasonwilliams
Copy link
Member

jasonwilliams commented Apr 18, 2020

Yep agree with the above it should be opt in rather than opt out. We can also move it to a wrapper crate

@Razican Razican added the good first issue Good for newcomers label Apr 18, 2020
@muskuloes
Copy link
Contributor

I would like to take this one. But will only be able to work on it from next week, if that's ok.

@Razican
Copy link
Member Author

Razican commented Apr 22, 2020

I would like to take this one. But will only be able to work on it from next week, if that's ok.

Sure, go ahead, let us know when you start! :)

@muskuloes
Copy link
Contributor

I can start now.

@Razican Razican linked a pull request Apr 28, 2020 that will close this issue
@Razican Razican added this to the v0.8.0 milestone Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers webassembly Anything related to using Boa with WASM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants