How to track latest versions of Elixir/Phoenix etc

I am new to the world of Elixir and Phoenix and just encountered an issue caused by the fact that I was using an out-of-date version of phx.new. I resolved it by running:

mix archive.install hex phx_new 1.6.2

Having found the latest version (1.6.2) by a process of trial and error - i.e. keep increasing the version until mix told me what the latest version was. I am concerned that I may miss subsequent updates to the core libraries.

I can see that my mix.exs contains the deps entry:

{:phoenix, "~> 1.6.2"}

but this feels a bit circular - i.e. I only got this new entry because I manually upgraded phx.new.

What is the recommended way of installing Elixir and Phoenix and staying up-to-date? I am running on OS-X and also use Linux.

I had been using brew to install/update Elixir and Phoenix - is this incorrect? Is hex the one-and-only solution? If hex, then what is the recommended usage? I just looked through the hex command options and was excited to find a command mix hex.outdated ut swhen I ran this I got the result:

No hex dependencies

Which was a bit disappointing.

I’d really like to find out how to avoid using obsolete packages :smiley:

1 Like

There’s a difference between mix phx.new which is just responsible for generating the initial set of files for a new phoenix project, and keeping the generated project up to date. mix hex.outdated does the latter – it tells you about available updates for your current mix project and its dependencies. The mix phx.new generator is globally installed and there’s no mix command to tell you it’s outdated. But you can look at the hex project phx_new | Hex to see which versions are available (they should usually map 1:1 to phoenix versions). To see which archives you have installed you can run mix archive. The list includes the versions of installed archives. Some of them even include custom checks to warn you if they should be updated.

4 Likes

Additionally to the said above.
With recent mix phx.new version you can check the installed version with mix phx.new --version.

1 Like

Thanks for the prompt responses. It’s a shame that version tracking seems to be something that I effectively have to do by hand. I feel I’ve been spoiled by the linux/yum and other version tracking systems :cry: Oh well…

Concerning the project deps one always could do mix deps.update --all (probably after mix hex.outdated).

1 Like

Search dependabot or renovate on github market.

There is difference between all of these and Hex/Mix. Yum/APT/etc. are in general “global” package managers that handle configuration for whole system. Hex/Mix on the other hand is mostly per-project package manager. This is the main difference between them.

But as other said, in most cases you do not even need phx_new installed, as if you are working on existing project, then there is no need for that tool. In existing project you can use mix hex.outdated and mix deps.update --all to automatically update all possible packages.

Just because it hasn’t been mentioned yet, you can run mix local.phx to update the phx_new archive.

7 Likes