elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.56k stars 662 forks source link

Proposal: Allow installing the latest package of a major version #2250

Open jfmengels opened 2 years ago

jfmengels commented 2 years ago

Quick Summary: I want a way to install a package knowing only its major version like elm install author/package@2.

This is a proposal that is an addition to the proposals to install specific versions of a package (that I'm sure exists somewhere).

This is a feature request for when the package installer becomes the next focus. I imagine that when that is released elm-json would become obsolete and that elm becomes the only tool that users will have to use. This proposal aims to indicate some use-cases that elm-json currently fills for tooling purposes, so that they also be included and that batch of work.

Use-case

While this could potentially be useful for Elm developers when they want to use the latest version of an outdated major version of a package, this would mostly be for tooling.

This behavior currently exists in elm-json, and elm-review depends on it. I'll explain the process for the latter.

elm-review takes the user's configuration, which is an Elm application with configuration as Elm code, and a list of elm-review packages as dependencies (and maybe other Elm packages if they wrote custom rules).

It then

The last step is done using elm-json install stil4m/elm-syntax@7 <and a couple more...>.

The dependencies are added so that users don't have to do so themselves and get a hard to understand error when they forget to do so.

The reason for indicating the major version is that if one of these packages releases a new major version incompatible with the previous major version, we don't force the latest major version and cause all current elm-review configuration to become un-compilable and un-runnable.

In practice, elm-review doesn't run elm-json install stil4m/elm-syntax@7 ... (at least for this), but instead elm-json solve stil4m/elm-syntax@7 ... <path-to-original-elm.json> which allows getting (and caching) the list of dependencies so that we don't have to write the elm.json file and then run elm-json install ... in a second step.

elm-review still uses install with the major version constraint when initializing a new configuration. To avoid asking the user to confirm the install prompt, elm-json install supports a --yes flag.

Summary of requests

github-actions[bot] commented 2 years ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.