wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

self update feature

Open ashleygwilliams opened this issue 5 years ago • 10 comments

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?

ashleygwilliams avatar Jan 16 '19 14:01 ashleygwilliams

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.

fitzgen avatar Jan 16 '19 18:01 fitzgen

yeah self update sounds good to me as well :)

ashleygwilliams avatar Jan 16 '19 21:01 ashleygwilliams

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.

alexcrichton avatar Jan 17 '19 16:01 alexcrichton

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 avatar Jan 17 '19 22:01 Pauan

@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 avatar Jan 17 '19 22:01 ashleygwilliams

@ashleygwilliams Ah, that makes sense. Is there some way we can ship pre-compiled binaries via cargo? Just thinking out loud here.

Pauan avatar Jan 17 '19 22:01 Pauan

@Pauan i am actually chatting with the cargo and crates.io teams about that! perhaps one day!

ashleygwilliams avatar Jan 17 '19 22:01 ashleygwilliams

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

andrewdavidmackenzie avatar Aug 23 '19 10:08 andrewdavidmackenzie

Has there been any progress on this? Is the only way to update wasm-pack via downloading a new installer from the site?

kaleidawave avatar Apr 08 '22 11:04 kaleidawave

@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.

Pauan avatar Apr 08 '22 15:04 Pauan