I need a suggestion here. So I have a phoenix project which is using this version
{:phoenix, “~> 1.4.10”}
and I want to update this to phoenix’s latest version. But the project is not on production but we are going to put this on production. Project is heavily using LiveView and it’s compiled with this version
{:phoenix_live_view, “~> 0.7.1”, override: true}
So already all the build file is compiled with this version. What steps should I take before updating to newer version and compiling a new build?
Also, how do I this carefully?
Update the dependencies in mix.exs to the latest versions.
Run mix deps.get
Go to the assets folders
Run npm install --force phoenix_live_view
When I am in doubt I delete the _build folder and then, run mix deps.unlock --allbefore, this is riskier because you will be updating all the packages. But generally I have had no problems.
Sometimes I create a totally new app to check which package versions it uses, in this case you could run mix phx.new my_new_project --live
You can leave the _build folder as is or delete it, it is not dangerous, it will be created again in the next compile.
Unlocking the dependencies with mix deps.unlock --all will update all the dependencies to their new versions as specified in mix.exs. Which in some uncommon cases could give you problems.
If you are unsure, make a copy of your entire folder and try to upgrade the copy. It should work.
Means 1.7 or greater. But you should check if you have at least 1.7 installed. If it is not, upgrade it. I have never had problems with new elixir versions.
Actually it’s not the LiveView API which has stopped. I’m talking about Project API’s. When I shifted to new version of phoenix which is 1.5.4 now. So whatever routes I have defined in my router somehow it’s not able to find that routes. Maybe I need to compare the both version and check what has changed till now.