-
Notifications
You must be signed in to change notification settings - Fork 412
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
feat(build): add first-class support for binary crates #736
base: master
Are you sure you want to change the base?
Conversation
61: Instructions for the stdweb backend in the hello example. r=grovesNL a=theypsilon Previously there weren't instructions to run the 'hello' example on stdweb, so I'm adding them. But I also noticed that the README.md is not quite right yet. The web-sys backend instructions seem obsolete, but I can't find and easy way to make it work with wasm-pack because 'hello' is a binary crate. Here is a pull request to make wasm-pack compatible with binary crates: rustwasm/wasm-pack#736 Co-authored-by: José manuel Barroso Galindo <theypsilon@gmail.com>
currently the way to get examples built is to throw |
|
issue with the original draft of this PR: if a binary is defined but required features aren't available, it doesn't get built, but this code still tries to run wasm-bindgen against it, causing problems. i fixed it, though. |
this handles, e.g., binaries missing required features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I can't find anything to complain about here, I also tried it locally, seems to work perfectly.
As mentioned in my review, I think the PR can be kept simpler if we don't try to handle compiling multiple packages at once here and leave that to #732.
Is there anything else that can be done to move this forward?
@boringcactus could I give you a hand rebasing this?
Other than a rebase (which #816 tried to do), is there anything else that is blocking the merge of this PR? |
Make sure these boxes are checked! 📦✅
rustfmt
installedcargo fmt
on the code base before submitting✨✨ 😄 Thanks so much for contributing to wasm-pack! 😄 ✨✨
fixes #734
Now that rustwasm/wasm-bindgen#1630 has been implemented, I think it's good to have the same support in
wasm-pack
.This implementation currently doesn't add
bin
entries inpackage.json
, partially because the docs on that field say that targets must be prefixed with#!/usr/bin/env node
and I'm not sure how or where to ensure that all and only binaries get that prefix. I don't think that feature is vital, but if other people think it's a must-have then I can take a look at adding it.