feat(build): add first-class support for binary crates#736
feat(build): add first-class support for binary crates#736boringcactus wants to merge 5 commits intowasm-bindgen:masterfrom
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: wasm-bindgen/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
daxpedda
left a comment
There was a problem hiding this comment.
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! 📦✅
rustfmtinstalledcargo fmton the code base before submitting✨✨ 😄 Thanks so much for contributing to wasm-pack! 😄 ✨✨
fixes #734
Now that wasm-bindgen/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
binentries inpackage.json, partially because the docs on that field say that targets must be prefixed with#!/usr/bin/env nodeand 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.