Skip to content

Commit 07640e5

Browse files
committed
Updated to LiveView 0.18
1 parent fe3be9b commit 07640e5

8 files changed

Lines changed: 66 additions & 55 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This application is an example of an Elixir LiveView based desktop application. It uses the elixir-desktop library and a local SQLite database to create a web-technology based desktop app.
44

5+
## Changes in 1.1
6+
7+
- Updated to Phoenix 1.7 and LiveView 0.18
8+
59
## Changes in 1.0
610

711
- Updated to Phoenix 1.6 with esbuild+dart_scss

config/config.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ config :dart_sass,
1717

1818
config :logger,
1919
handle_otp_reports: true,
20-
handle_sasl_reports: true,
20+
handle_sasl_reports: false,
2121
backends: [:console]
2222

2323
config :logger, :console,

lib/todo_web.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ defmodule TodoWeb do
3535

3636
# Import convenience functions from controllers
3737
import Phoenix.Controller,
38-
only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1]
38+
only: [view_module: 1, view_template: 1]
39+
40+
alias Phoenix.Flash
3941

4042
# Include shared imports and aliases for views
4143
unquote(view_helpers())
@@ -46,7 +48,7 @@ defmodule TodoWeb do
4648
def live_view do
4749
quote do
4850
use Phoenix.LiveView,
49-
layout: {TodoWeb.LayoutView, "live.html"}
51+
layout: {TodoWeb.LayoutView, :live}
5052

5153
unquote(view_helpers())
5254
alias TodoWeb.Router.Helpers, as: Routes
@@ -86,6 +88,7 @@ defmodule TodoWeb do
8688

8789
# Import LiveView helpers (live_render, live_component, live_patch, etc)
8890
import Phoenix.LiveView.Helpers
91+
import Phoenix.Component
8992

9093
# Import basic rendering functionality (render, render_layout, etc)
9194
import Phoenix.View
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<main role="main" class="container">
2-
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
3-
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
2+
<p class="alert alert-info" role="alert"><%= Flash.get(@conn, :info) %></p>
3+
<p class="alert alert-danger" role="alert"><%= Flash.get(@conn, :error) %></p>
44
<%= @inner_content %>
55
</main>

mix.exs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
defmodule Todo.MixProject do
22
use Mix.Project
33

4-
@version "1.0.0"
4+
@version "1.1.0"
55
def project do
66
[
77
app: :todo_app,
88
version: @version,
99
elixir: "~> 1.10",
1010
elixirc_paths: elixirc_paths(Mix.env()),
11-
compilers: [:phoenix | Mix.compilers()],
11+
compilers: Mix.compilers(),
1212
start_permanent: Mix.env() == :prod,
1313
deps: deps(),
1414
aliases: aliases()
@@ -63,24 +63,25 @@ defmodule Todo.MixProject do
6363
deps_list = [
6464
{:ecto_sqlite3, "~> 0.8"},
6565
{:exqlite, github: "elixir-desktop/exqlite", override: true},
66-
# {:desktop, path: "../desktop"},
67-
{:desktop, "~> 1.4"},
66+
{:desktop, path: "../desktop"},
67+
# {:desktop, "~> 1.4"},
6868

6969
# Phoenix
70-
{:phoenix, "~> 1.6"},
71-
{:phoenix_live_view, "~> 0.17.11"},
70+
{:phoenix, "~> 1.7"},
71+
{:phoenix_live_view, "~> 0.18"},
7272
{:phoenix_html, "~> 3.0"},
73-
{:phoenix_live_reload, "~> 1.3", only: [:dev]},
74-
{:gettext, "~> 0.18"},
75-
{:plug_cowboy, "~> 2.5"},
76-
{:jason, "~> 1.2"},
73+
{:phoenix_view, "~> 2.0"},
74+
{:phoenix_live_reload, "~> 1.4", only: [:dev]},
75+
{:gettext, "~> 0.22"},
76+
{:plug_cowboy, "~> 2.6"},
77+
{:jason, "~> 1.4"},
7778

7879
# Assets
79-
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
80-
{:dart_sass, "~> 0.2", runtime: Mix.env() == :dev},
80+
{:esbuild, "~> 0.7", runtime: Mix.env() == :dev},
81+
{:dart_sass, "~> 0.5", runtime: Mix.env() == :dev},
8182

8283
# Credo
83-
{:credo, "~> 1.5", only: [:dev, :test], runtime: false}
84+
{:credo, "~> 1.7", only: [:dev, :test], runtime: false}
8485
]
8586

8687
if Mix.target() in [:android, :ios] do

mix.lock

Lines changed: 17 additions & 14 deletions
Large diffs are not rendered by default.

priv/gettext/de/LC_MESSAGES/default.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
msgid ""
1010
msgstr ""
1111
"Language: de\n"
12-
"Plural-Forms: nplurals=2\n"
12+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
1313

1414
#, elixir-format
1515
#: lib/todo_app/menubar.eex:14

priv/gettext/default.pot

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,68 @@
1010
msgid ""
1111
msgstr ""
1212

13-
#, elixir-format
1413
#: lib/todo_app/menubar.eex:14
14+
#, elixir-format
1515
msgid "About"
1616
msgstr ""
1717

18-
#, elixir-format
19-
#: lib/todo_app/menubar.eex:2 lib/todo_app/menubar.ex:14
18+
#: lib/todo_app/menu_bar.ex:14
19+
#, elixir-format, elixir-autogen
2020
msgid "File"
2121
msgstr ""
2222

23-
#, elixir-format
2423
#: lib/todo_app/menubar.eex:13
24+
#, elixir-format
2525
msgid "Help"
2626
msgstr ""
2727

28-
#, elixir-format
29-
#: lib/todo_app/menu.eex:2
28+
#: lib/todo_app/menu.html.heex:2
29+
#, elixir-format, elixir-autogen
3030
msgid "Open"
3131
msgstr ""
3232

33-
#, elixir-format
34-
#: lib/todo_app/menu.eex:12 lib/todo_app/menubar.eex:11
35-
#: lib/todo_app/menubar.ex:22
33+
#: lib/todo_app/menu.html.heex:12
34+
#: lib/todo_app/menu_bar.ex:22
35+
#, elixir-format, elixir-autogen
3636
msgid "Quit"
3737
msgstr ""
3838

39-
#, elixir-format
40-
#: lib/todo_app/menubar.ex:56
39+
#: lib/todo_app/menu_bar.ex:56
40+
#, elixir-format, elixir-autogen
4141
msgid "Sample Elixir Desktop App!"
4242
msgstr ""
4343

44-
#, elixir-format
45-
#: lib/todo_app/menubar.ex:24
44+
#: lib/todo_app/menu_bar.ex:24
45+
#, elixir-format, elixir-autogen
4646
msgid "Extra"
4747
msgstr ""
4848

49-
#, elixir-format
50-
#: lib/todo_app/menubar.ex:27
49+
#: lib/todo_app/menu_bar.ex:27
50+
#, elixir-format, elixir-autogen
5151
msgid "Open Browser"
5252
msgstr ""
5353

54-
#, elixir-format
55-
#: lib/todo_app/menubar.ex:25
54+
#: lib/todo_app/menu_bar.ex:25
55+
#, elixir-format, elixir-autogen
5656
msgid "Show Notification"
5757
msgstr ""
5858

59-
#, elixir-format
60-
#: lib/todo_app/menubar.ex:26
59+
#: lib/todo_app/menu_bar.ex:26
60+
#, elixir-format, elixir-autogen
6161
msgid "Show Observer"
6262
msgstr ""
6363

64-
#, elixir-format
6564
#: lib/todo_web/templates/layout/root.html.leex:8
65+
#, elixir-format, elixir-autogen
6666
msgid " · Your Todos"
6767
msgstr ""
6868

69-
#, elixir-format
7069
#: lib/todo_web/live/todo_live.html.leex:4
70+
#, elixir-format, elixir-autogen
7171
msgid "Add new todo item..."
7272
msgstr ""
7373

74-
#, elixir-format
7574
#: lib/todo_web/live/todo_live.html.leex:2
75+
#, elixir-format, elixir-autogen
7676
msgid "My Todo List"
7777
msgstr ""

0 commit comments

Comments
 (0)