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
Create npm installer #738
Create npm installer #738
Conversation
e572aa3
to
c7dd6db
Compare
Thanks a lot for starting on this! I wonder if we could just create an npm package which contains the pre-built binaries (and a simple script as a fallback), and then just publish that. That avoids needing to manage our own hosting, and it also means that versioning will work correctly (including version locking). The alternative would be to point to the release files already hosted on GitHub, this strategy is used by PureScript. |
Hosting is definitely something to consider.
That's what the EDIT: The source code for that worker script is open source: https://github.com/cloudflare/lasso/blob/master/cache-dependency-binary/index.js and Cloudflare Workers has a free tier so setting up a gateway like this shouldn't be cost prohibitive. Disclaimer: I work for Cloudflare π |
My understanding is that GitHub has no rate limits on releases. I assume that they also heavily cache it, because the releases are immutable and cannot change. |
c7dd6db
to
335fc57
Compare
Well in that case let's just use the Github releases! I've updated the PR to pull directly from Github. |
335fc57
to
f2ad824
Compare
This PR creates an npm installer for
wasm-pack
that downloads and installs a binary. It uses this unpublished package for installing binaries https://github.com/everlastingbugstopper/binary-install.It currently downloads from a workers.cloudflare endpoint that we'd likely want to change to something that the rustwasm working group has control over.
We also probably want some more keywords before this would be published - currently I've just copied the same tags from the repository.
Proof that it works
Uninstalling will remove the downloaded binary, and installing a new version will overwrite the old downloaded binary.
Some caveats:
The README will need to be updated on every wasm-pack release, and the version number in package.json will also need to be bumped on every release.
Fixes #321