Skip to content

Conversation

lalten
Copy link
Contributor

@lalten lalten commented Jul 10, 2025

This allows you to specify something like v8.2.1 in the buildifierExecutable config, and the extension will download the buildifier binary for that release for you.

Fixes #371 (only regarding Buildifier for now, and without any fancy Wasm involvement).

I'm not a Typescript expert so I'm happy to receive feedback.

@cbandera
Copy link
Contributor

I'm not a Typescript expert either, but the implementation looks good and clean to me!

I am wondering about the user interface though. With the current setup, one config option string is used for three different kinds of information: a path, a label or a version to be downloaded. I understand that this avoids a breaking change, but it doesn't really feel smooth. Have you considered splitting it into three config items?

And how about defaulting to downloading the latest version if no path/label/version was specified and no executable could be found on the path?

@lalten
Copy link
Contributor Author

lalten commented Jul 24, 2025

Have you considered splitting it into three config items?

I did in fact try using option groups and a drop-down for selecting type of value, and value. But that quickly made the code pretty complex.

And how about defaulting to downloading the latest version if no path/label/version was specified and no executable could be found on the path?

I initially wanted to default to latest but the issue is that you don't know if latest has changed, so the extension would need to periodically check if it needs to redownload. Another issue is that the direct asset download links it's constructing now don't work for latest.
I guess you'd have to use the GH API to ask what release is latest.
And then again, more complexity, when the current setup is just fine. It's actually kinda nice to not get surprise updates that change formatting I guess.

@cameron-martin
Copy link
Collaborator

I'm also slightly concerned about overloading a single string with three potentially overlapping meanings. I'm not sure of the best pattern to represent cases like this though - essentially like a Rust enum where the available values depend on a tag.

I initially wanted to default to latest but the issue is that you don't know if latest has changed, so the extension would need to periodically check if it needs to redownload. Another issue is that the direct asset download links it's constructing now don't work for latest.

One option would be to bake into the extension what version is considered "latest", and rely on a new release to update this. That way hashes could be embedded for integrity checks too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-install tools
3 participants