Closed SimonLab closed 2 years ago
@SimonLab thanks for opening this. 👌 Reviewing your PR #184 now 👀
Merged. ✅ But I think it's worth having this as a step in one of our tutorials e.g: https://github.com/dwyl/phoenix-liveview-chat-example So that we can remind ourselves of what needs to be added in future projects. ðŸ’
I'm not sure if the future new version of Phoenix will add the heex formatter automatically in the .formatter
file.
I'll open an issue on the liveview-chat-example to remind me to add the step in the Readme :+1:
Yeah, will make perfect sense for future Phoenix
to include this out-of-the-box. 👌
Arf, the main branch failed and didn't deployed the last PR as:
So the liveView formatter module is still not found, however it looks like the router
file is not formatted, I'll have a look at what could be wrong. However If this step becomes annoying with the Github CI, I think we could remove it for now
running mix compile
before mix format
seems to be the solution to be able to use the Phoenix.LiveView.Formatter plugin.
see https://github.com/elixir-lang/elixir/issues/11915#issuecomment-1233077725
This might be fixed with Elixir 1.4. Might be worth updating the version of Elixir used with Github CI
Updating the version of elixir to 1.14 seems to work for running mix format
on Github CI.
It will automatically run mix compile
before running mix format
I'm looking now at updating the Dockerfile to make sure the application can be deployed on Fly using the correct version. We can see which versions to select for Elixir OTP and debian at https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=slim
I've seen a couple of posts already on the Fly community where people had issue deploying with Elixir 1.14: https://community.fly.io/t/no-love-with-first-deployment-attempt-of-phoenix-app/7358/2
Hopfully selected the correct Debian and elixir/OTP version on the Dockerfile should also work for us.
Thanks for looking into this @SimonLab 👌
Just to make sure the application has been deployed with the correct versions:
fly ssh console
/app/bin/app remote
LiveView 0.18 provide a formatter plugin for the
heex
files: Phoenix.LiveView.HTMLFormatterI think it requires Elixir 1.3 to be able to work and we need to update the
.formatter
file as described in the setup sectionI'm also tempted to add
mix format --check-formatted
action on the Github actions to make sure PRs are formatted, this shouldn't be too annoying as I think most of editors have the option to format the code when a file is saved.