wasm-pack
wasm-pack copied to clipboard
self update feature
i'd like to propose a self-update function that when run, will update your wasm-pack to the latest version.
wasm-pack update
i think we can leverage the install script that @alexcrichton introduce a few releases ago and have wasm-pack run it itself.
we'll need to detect the users operating system.
downsides i can think of are if the user somehow ended up install wasm-pack in such a way that it's ended up in a place we can't detect or expect. i'm not sure how large the surface area of that ambiguity is.
another downside is of course (something i've experience at npm) which is, if we break the self-update mechanism or install mechanism such that this wouldn't work. i think that since there are other ways to manually install it that are ready at hand (unlike npm), that we'd be ok with a way to help end users fix the issue.
thoguhts?
Maybe wasm-pack self update
? Just to be super clear that we aren't updating the project's lockfiles or deps or anything like that.
Otherwise, I am +1 on this feature.
I defer to @alexcrichton for more info on how to implement it well and what other issues / edge cases we may encounter, based on his experience with cargo.
yeah self update
sounds good to me as well :)
I think is definitely a nice-to-have, and the main body of work here is going to be implementing and designing this. Self-update is notoriously complicated on Windows and is also a problem that is generally easy to break by accident.
Rather than reinventing the wheel and creating custom installation/updating scripts, why aren't we just using cargo? Then it's just cargo install -f wasm-pack
@Pauan we have been asking folks to install using a binary since 0.5.0 to avoid the need to compile on their machine! it's long and sometimes tricky and prebuilt binaries are very pleasant to work with.
@ashleygwilliams Ah, that makes sense. Is there some way we can ship pre-compiled binaries via cargo? Just thinking out loud here.
@Pauan i am actually chatting with the cargo and crates.io teams about that! perhaps one day!
maybe a --bin option on cargo to specify you want the binary for your machine/arch/os (triple) instead of compiling from source? something like cargo install --bin wasm-pack
Has there been any progress on this? Is the only way to update wasm-pack via downloading a new installer from the site?
@kaleidawave If you use the npm package then it will update to the latest version through npm (e.g. npm update
or yarn upgrade
). It also supports lockfiles, so you get a reproducible result. That's currently the easiest way to stay up-to-date.