Update Elixir version to current
The Elixir upgrade is complete. Here's a summary of changes made:
Summary
Updated to Elixir 1.19 with the following changes:
mix.exs
- Elixir version:
~> 1.7→~> 1.19 - Removed deprecated
:phoenixand:gettextcompilers - Updated all dependencies to modern versions:
- Phoenix 1.7+, LiveView 1.0+, Ecto 3.12+
- Replaced Bamboo with Swoosh for email
- Replaced prometheus_* libraries with PromEx
- Added phoenix_html_helpers, phoenix_view for compatibility
Config files
- All files:
use Mix.Config→import Config - Created config/runtime.exs for production secrets
- Removed config/prod.secret.exs import
Code updates
- lib/typeracer/repo.ex: Use
Application.compile_env/3 - lib/typeracer_web/gettext.ex: Use
Gettext.Backend - lib/typeracer_web.ex: Modern Phoenix patterns
- lib/typeracer/mailer.ex & email.ex: Swoosh adapter
- lib/typeracer/prom_ex.ex: New metrics module
- Removed old
lib/typeracer/instrumenters/directory
Build config
- elixir_buildpack.config: Elixir 1.19.0, Erlang 27.0
Build succeeded. The npm dependencies have been updated:
- Replaced
node-sasswithsass(Dart Sass) - Updated webpack from 4 to 5
- Replaced
lit-elementwithlit(the modern package) - Removed deprecated
babel-polyfill - Updated all other dependencies to modern versions
The server is now starting successfully. The output shows:
Running TyperacerWeb.Endpoint with cowboy 2.14.2 at 0.0.0.0:4000 (http)Access TyperacerWeb.Endpoint at http://localhost:4000- Webpack compiled successfully
The fix was changing --watch-stdin to --watch in the dev.exs config - webpack 5 dropped support for --watch-stdin.
You can now run mix phx.server and access the app at http://localhost:4000.
The /login page is now working. The fix was adding plug :put_view, TyperacerWeb.LoginView to each controller to explicitly set the view module for rendering templates.
All warnings have been fixed. The server now starts cleanly with only the expected info/notice messages (disk space notices are from your system, not the application).
Summary of fixes:
- Replaced deprecated
get_flash(@conn, :key)withPhoenix.Flash.get(@flash, :key)in layout templates - Added
formats: [:html, :json]to the controller definition - Updated
put_viewto usehtml:keyword syntax - Fixed struct update warnings in
lobby_state.exby adding pattern matching on struct types - Removed unused
lcp([])clause