Skip to content

Commit

Permalink
Merge pull request #53 from brunojppb/update-elixir
Browse files Browse the repository at this point in the history
Update Elixir and Erlang
  • Loading branch information
brunojppb authored Dec 3, 2024
2 parents fe8336d + c99726e commit 886ae22
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 26.0.2
elixir 1.15.4
erlang 27.1.2
elixir 1.17.3
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#
ARG ELIXIR_VERSION
ARG OTP_VERSION
ARG UBUNTU_VERSION=jammy-20230126
ARG UBUNTU_VERSION=jammy-20240808

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-ubuntu-${UBUNTU_VERSION}"
ARG RUNNER_IMAGE="ubuntu:${UBUNTU_VERSION}"
Expand Down Expand Up @@ -98,4 +98,4 @@ COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/turbo ./

USER nobody

CMD ["./entrypoint.sh"]
CMD ["./entrypoint.sh"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ You can use our Digital Ocean template to get this running quickly in a droplet.

To run this app locally, you need the following dependencies installed:

- [Elixir 1.14](https://elixir-lang.org/) and
[Erlang OTP 25](https://www.erlang.org/)
- [Elixir 1.17](https://elixir-lang.org/) and
[Erlang OTP 27](https://www.erlang.org/)
- You can quickly do it with [asdf](https://asdf-vm.com/). Once asdf is
installed and then execute `asdf install` within the context of the
`turbo-racer` directory. It will automatically pick up the right Elixir and
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ services:
ports:
- "5432:5432"
volumes:
- ./db:/var/lib/postgresql/data
- ./priv/support/create_test_db.sql:/docker-entrypoint-initdb.d/1-schema.sql
- db:/var/lib/postgresql/data
- ./priv/support/create_test_db.sql:/docker-entrypoint-initdb.d/1-schema.sql

volumes:
db:
2 changes: 1 addition & 1 deletion lib/turbo/storage/local_file_store.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Turbo.Storage.LocalFileStore do
path = build_path(filename)

if File.exists?(path) do
{:ok, File.stream!(path, [], 2048)}
{:ok, File.stream!(path, 2048)}
else
{:error, "#{filename} not found"}
end
Expand Down
6 changes: 3 additions & 3 deletions lib/turbo_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ defmodule TurboWeb do
def controller do
quote do
use Phoenix.Controller, namespace: TurboWeb
use Gettext, backend: Turbo.Gettext

import Plug.Conn
import TurboWeb.Gettext
alias TurboWeb.Router.Helpers, as: Routes

unquote(verified_routes())
Expand Down Expand Up @@ -111,14 +111,15 @@ defmodule TurboWeb do
def channel do
quote do
use Phoenix.Channel
import TurboWeb.Gettext
use Gettext, backend: Turbo.Gettext
end
end

defp view_helpers do
quote do
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
use Gettext, backend: Turbo.Gettext

# Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc)
import Phoenix.Component
Expand All @@ -127,7 +128,6 @@ defmodule TurboWeb do
import Phoenix.View

import TurboWeb.ErrorHelpers
import TurboWeb.Gettext
alias TurboWeb.Router.Helpers, as: Routes

unquote(verified_routes())
Expand Down
2 changes: 1 addition & 1 deletion lib/turbo_web/gettext.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ defmodule TurboWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
use Gettext, otp_app: :turbo
use Gettext.Backend, otp_app: :turbo
end
4 changes: 2 additions & 2 deletions lib/turbo_web/templates/layout/live.html.heex
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<main class="container">
<p class="alert alert-info" role="alert" phx-click="lv:clear-flash" phx-value-key="info">
<%= live_flash(@flash, :info) %>
<%= Phoenix.Flash.get(@flash, :info) %>
</p>

<p class="alert alert-danger" role="alert" phx-click="lv:clear-flash" phx-value-key="error">
<%= live_flash(@flash, :error) %>
<%= Phoenix.Flash.get(@flash, :error) %>
</p>

<%= @inner_content %>
Expand Down
1 change: 1 addition & 0 deletions lib/turbo_web/views/error_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule TurboWeb.ErrorHelpers do
@moduledoc """
Conveniences for translating and building error messages.
"""
use Gettext, backend: Turbo.Gettext

use Phoenix.HTML

Expand Down
44 changes: 22 additions & 22 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ defmodule Turbo.MixProject do
[
app: :turbo,
name: "Turbo Racer",
version: "1.6.0",
elixir: "~> 1.15",
version: "2.0.0",
elixir: "~> 1.17",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -38,34 +38,34 @@ defmodule Turbo.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:bcrypt_elixir, "~> 3.0"},
{:phoenix, "~> 1.7.2"},
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.10"},
{:ex_aws, "~> 2.4"},
{:ex_aws_s3, "~> 2.4"},
{:bcrypt_elixir, "~> 3.2"},
{:phoenix, "~> 1.7.15"},
{:phoenix_ecto, "~> 4.6"},
{:ecto_sql, "~> 3.12"},
{:ex_aws, "~> 2.5"},
{:ex_aws_s3, "~> 2.5"},
{:sweet_xml, "~> 0.7"},
{:hackney, "~> 1.18"},
{:hackney, "~> 1.20"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.3.1"},
{:phoenix_view, "~> 2.0"},
{:phoenix_live_view, "~> 0.18.18"},
{:phoenix_live_dashboard, "~> 0.7.2"},
{:swoosh, "~> 1.10"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.22"},
{:phoenix_live_view, "~> 0.20"},
{:phoenix_live_dashboard, "~> 0.8"},
{:swoosh, "~> 1.17"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 1.1"},
{:gettext, "~> 0.26"},
{:jason, "~> 1.4"},
{:plug_cowboy, "~> 2.6"},
{:oban, "~> 2.15"},
{:plug_cowboy, "~> 2.7"},
{:oban, "~> 2.18"},
# Dev dependencies
{:dialyxir, "~> 1.2", only: [:dev], runtime: false},
{:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.1", runtime: Mix.env() == :dev},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
{:phoenix_live_reload, "~> 1.5", only: :dev},

# Test dependencies
{:floki, "~> 0.34", only: :test}
{:floki, "~> 0.36", only: :test}
]
end

Expand Down
Loading

0 comments on commit 886ae22

Please sign in to comment.