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

Cargo-web support? #471

Open
mvlabat opened this issue Dec 26, 2018 · 5 comments
Open

Cargo-web support? #471

mvlabat opened this issue Dec 26, 2018 · 5 comments

Comments

@mvlabat
Copy link

mvlabat commented Dec 26, 2018

💡 Feature description

Some crates may require using cargo-web to build. For example, stdweb.
Will it make sense to detect if cargo-web is installed and use it for compiling projects?

@ashleygwilliams
Copy link
Member

@mvlabat - this project was primarily created to support the wasm-bindgen use case, but to the extent that it's not overly complicating i would definitely be interested in exploring supporting stdweb as well!

if you'd like- if you could comment here with what you'd imagine the plan for integrating stdweb, we can discuss here and decide if it makes sense! i'm certainly not opposed, and i think it'd be exciting to get it to work!

@ashleygwilliams ashleygwilliams added enhancement New feature or request question Further information is requested feature request help wanted Extra attention is needed labels Dec 27, 2018
@mvlabat
Copy link
Author

mvlabat commented Dec 27, 2018

@ashleygwilliams, thanks for the answer and your open position about this!

An argument for doing it (though maybe not a very strong one) is that wasm-pack is used in some workflows utilizing JS building tools. Don't know about Webpack ecosystem, but Parcel, for instance, has such plugin: https://github.com/catsigma/parcel-plugin-wasm.rs. It detects if wasm-pack is installed on user's system and if so it uses it as a default build instrument for compiling Rust dependencies.
So the point is that this feature could bring cargo-web support to JS bulding tools (supporting wasm-pack) probably without any effort.

I think that one way of implementing this could be just to detect if Web.toml exists for a project. Or, if a user doesn't have any configuration, they could use some special CLI attribute that tells wasm-pack to use cargo-web binary.

Btw - about the wasm-bindgen use case - I've just stumbled upon this issue: koute/cargo-web#92. It seems that exactly this use case is not currently possible. :)

@alexcrichton
Copy link
Contributor

I personally think that the way forward here is koute/stdweb#318, not having wasm-pack delegate to cargo web. The issue runs much deeper in terms of library configuration and such, and having a unified story would allow us to reap many more benefits!

@fitzgen
Copy link
Member

fitzgen commented Jan 10, 2019

I agree that koute/stdweb#318 is the best way to unify. I think trying to wrap cargo web would just add more maintenance burden and should become unnecessary relatively quickly.

@ashleygwilliams
Copy link
Member

now that koute/stdweb#318 has landed - i think we can close this. are there any outstanding todos?

@ashleygwilliams ashleygwilliams added needs more info needs discussion and removed enhancement New feature or request feature request help wanted Extra attention is needed question Further information is requested labels Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants