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

Clarify intent of wasm-pack and commands #466

Closed
grovesNL opened this issue Dec 20, 2018 · 4 comments
Closed

Clarify intent of wasm-pack and commands #466

grovesNL opened this issue Dec 20, 2018 · 4 comments
Labels
marketing PR attached there's a PR open for this issue question Further information is requested
Milestone

Comments

@grovesNL
Copy link

The description of wasm-pack in this repository:

wasm-pack helps you build and publish rust-generated WebAssembly to the npm registry to be used alongside any other javascript package in workflows that you already use, such as webpack or greenkeeper.

This seems to indicate wasm-pack is only used when publishing the output to a registry, but wasm-pack appears to be usable for other use cases. The front page at https://rustwasm.github.io/wasm-pack/ also doesn't contain many details which makes it difficult to understand the intended use cases. This is a bit confusing for users that don't want to publish to npm (for example, running wasm-pack build for internal use in their project).

I wanted to raise this here because rustwasm/wasm-bindgen#1120 mentioned that wasm-pack is an appropriate replacement for the example build scripts there. It seems to be working great and gives me the expected output, but I'm unsure if I'm misusing the CLI (Your wasm pkg is ready to publish at "/Users/josh/Projects/js-hello-world/pkg". even though I don't want to publish anything).

@grovesNL
Copy link
Author

The commands section in the book describes the commands pretty well and does clarify that publishing is optional. So I guess there could be some improvements here:

  • Add more details about possible use cases for wasm-pack on both gh-pages and repository readme could be useful.
  • Maybe wasm-pack build should note that publishing is optional or rephrase the current message.
  • Describe how to setup a project to match the examples in wasm-bindgen. For example, whenever I run wasm-pack build the package.json is overwritten, so it's unclear how to add a serve script to the pkg/package.json without it being replaced each time. Maybe there's another way to do it but glancing through the documentation it wasn't obvious.

Let me know if there are established best practices already, I'd be happy to send a PR to try to clarify.

@ashleygwilliams
Copy link
Member

hi @grovesNL ! you are absolutely correct- wasm-pack certainly doesn't require that you publish to the registry. originally, when we came up with wasm-pack it was indeed just a publishing tool- however it's since grown into an integrated build tool that does quite a bit more than was the original plan, and certainly doesn't require that folks publish.

i would welcome a PR to update the messaging if you're interested. i intend to get a release out today/tomorrow, and can also do some wordsmithing (and website improvement) :) thanks for filing!

@ashleygwilliams ashleygwilliams added question Further information is requested marketing PR welcome labels Dec 21, 2018
@grovesNL grovesNL changed the title Clarifiy intent of wasm-pack and commands Clarify intent of wasm-pack and commands Dec 22, 2018
@ashleygwilliams ashleygwilliams added this to the 0.6.0 milestone Dec 27, 2018
@ashleygwilliams ashleygwilliams added PR attached there's a PR open for this issue and removed PR welcome labels Dec 28, 2018
@ashleygwilliams ashleygwilliams modified the milestones: 0.6.0, 0.7.0 Jan 11, 2019
@ashleygwilliams ashleygwilliams modified the milestones: 0.8.0, 0.7.0 Mar 14, 2019
@ashleygwilliams
Copy link
Member

this is going to be handled partially by a PR in this repo and partially in a set of others! i'm closing because we'll file more granular issues for the to do items, thank you so much for this thoughtful issue! it was very helpful :)

@grovesNL
Copy link
Author

Sounds great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
marketing PR attached there's a PR open for this issue question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants