Browse Source

feat: update to Phoenix 1.5 RC0 :))

pull/26/head
Inhji Y. 1 year ago
parent
commit
756045bcd5
  1. 2
      apps/bookmarks/lib/bookmarks/application.ex
  2. 2
      apps/bookmarks/mix.exs
  3. 38
      apps/tomie_web/lib/tomie_web.ex
  4. 4
      apps/tomie_web/lib/tomie_web/application.ex
  5. 4
      apps/tomie_web/lib/tomie_web/templates/layout/app.html.eex
  6. 1
      apps/tomie_web/lib/tomie_web/templates/layout/live.html.eex
  7. 3
      apps/tomie_web/lib/tomie_web/templates/layout/live.html.leex
  8. 4
      apps/tomie_web/lib/tomie_web/templates/layout/root.html.leex
  9. 6
      apps/tomie_web/mix.exs
  10. 2
      config/config.exs
  11. 6
      mix.lock

2
apps/bookmarks/lib/bookmarks/application.ex

@ -3,7 +3,7 @@ defmodule Bookmarks.Application do
def start(_type, _args) do
children = [
{Phoenix.PubSub.PG2, name: Bookmarks.PubSub}
{Phoenix.PubSub, name: Bookmarks.PubSub}
]
Supervisor.start_link(children, strategy: :one_for_one, name: Bookmarks.Supervisor)

2
apps/bookmarks/mix.exs

@ -30,7 +30,7 @@ defmodule Bookmarks.MixProject do
{:que, "~> 0.10.1"},
{:earmark, "~> 1.4"},
{:ecto_sql, "~> 3.1"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_pubsub, "~> 2.0"},
{:mock, "~> 0.3.0", only: :test},
{:excoveralls, "~> 0.12.3", only: :test},
{:db, in_umbrella: true},

38
apps/tomie_web/lib/tomie_web.ex

@ -22,16 +22,15 @@ defmodule TomieWeb do
use Phoenix.Controller, namespace: TomieWeb
import Plug.Conn
import TomieWeb.Gettext
import Phoenix.LiveView.Controller
alias TomieWeb.Router.Helpers, as: Routes
alias TomieWeb.Worker
end
end
def live do
quote do
use Phoenix.LiveView
alias TomieWeb.Router.Helpers, as: Routes
use Phoenix.LiveView, layout: {TomieWeb.LayoutView, "live.html"}
unquote(view_helpers())
end
end
@ -43,19 +42,20 @@ defmodule TomieWeb do
# Import convenience functions from controllers
import Phoenix.Controller, only: [get_flash: 1, get_flash: 2, view_module: 1]
import Phoenix.LiveView.Helpers
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
# Import external modules
import PhoenixActiveLink
import TomieWeb.ErrorHelpers
import TomieWeb.Gettext
import PhoenixFormAwesomplete
# Include shared imports and aliases for views
unquote(view_helpers())
end
end
alias TomieWeb.Router.Helpers, as: Routes
def live_component do
quote do
use Phoenix.LiveComponent
unquote(view_helpers())
end
end
@ -76,6 +76,20 @@ defmodule TomieWeb do
end
end
defp view_helpers do
quote do
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
# Import convenience functions for LiveView rendering
import Phoenix.LiveView.Helpers
import TomieWeb.ErrorHelpers
import TomieWeb.Gettext
alias TomieWeb.Router.Helpers, as: Routes
end
end
@doc """
When used, dispatch to the appropriate controller/view/etc.
"""

4
apps/tomie_web/lib/tomie_web/application.ex

@ -9,9 +9,9 @@ defmodule TomieWeb.Application do
# List all child processes to be supervised
children = [
# Start the endpoint when the application starts
TomieWeb.Endpoint
TomieWeb.Endpoint,
# Starts a worker by calling: TomieWeb.Worker.start_link(arg)
# {TomieWeb.Worker, arg},
{Phoenix.PubSub, name: TomieWeb.PubSub}
]
# See https://hexdocs.pm/elixir/Supervisor.html

4
apps/tomie_web/lib/tomie_web/templates/layout/app.html.eex

@ -1 +1,3 @@
<%= render @view_module, @view_template, assigns %>
<main role="main" id="content" class="px-0 py-6 sm:p-6">
<%= @inner_content %>
</main>

1
apps/tomie_web/lib/tomie_web/templates/layout/live.html.eex

@ -1 +0,0 @@
<h1>Live Layout!!!</h1>

3
apps/tomie_web/lib/tomie_web/templates/layout/live.html.leex

@ -0,0 +1,3 @@
<main role="main" id="content" class="px-0 py-6 sm:p-6">
<%= @inner_content %>
</main>

4
apps/tomie_web/lib/tomie_web/templates/layout/root.html.eex → apps/tomie_web/lib/tomie_web/templates/layout/root.html.leex

@ -53,9 +53,7 @@
</ul>
</nav>
<main role="main" id="content" class="px-0 py-6 sm:p-6">
<%= @inner_content %>
</main>
<%= @inner_content %>
<script type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</body>

6
apps/tomie_web/mix.exs

@ -38,8 +38,8 @@ defmodule TomieWeb.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.4.16"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix, "~> 1.5.0-rc.0", override: true},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
@ -48,7 +48,7 @@ defmodule TomieWeb.MixProject do
{:phoenix_active_link, "~> 0.3.0"},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:plug_cowboy, "~> 2.1"},
{:pow, "~> 1.0.19"},
{:que, "~> 0.10.1"},
{:excoveralls, "~> 0.12.3", only: :test},

2
config/config.exs

@ -25,7 +25,7 @@ config :tomie_web, TomieWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "vA2gj8nBFMrN/nH0bjo09DfxDovTsbUZJbpnsawqXsTneL/F0nWEY5PfY5uptNra",
render_errors: [view: TomieWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: TomieWeb.PubSub, adapter: Phoenix.PubSub.PG2],
pubsub_server: TomieWeb.PubSub,
live_view: [signing_salt: "La8TeKsJi1aZt2Bhp8vXfx9HOOFpP/JY"]
config :tomie_web, :pow,

6
mix.lock

@ -37,16 +37,16 @@
"nimble_parsec": {:hex, :nimble_parsec, "0.5.3", "def21c10a9ed70ce22754fdeea0810dafd53c2db3219a0cd54cf5526377af1c6", [:mix], [], "hexpm", "589b5af56f4afca65217a1f3eb3fee7e79b09c40c742fddc1c312b3ac0b3399f"},
"open_graph_extended": {:git, "https://git.inhji.de/inhji/open_graph.git", "bed84f89524ec5ba12ab85018ff6f166cfff7a3d", []},
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"},
"phoenix": {:hex, :phoenix, "1.4.16", "2cbbe0c81e6601567c44cc380c33aa42a1372ac1426e3de3d93ac448a7ec4308", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "856cc1a032fa53822737413cf51aa60e750525d7ece7d1c0576d90d7c0f05c24"},
"phoenix": {:hex, :phoenix, "1.5.0-rc.0", "383ba0e00fc78c05fe9a78505a16f868123eb287ad1e0fce22ce9ec7a32cacef", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.1", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1c37b18d7dca8b4e45884274c65f1479c8e80c840099cad065b4259667af9366"},
"phoenix_active_link": {:hex, :phoenix_active_link, "0.3.0", "7c04e68aec9ea545fb2c3bba9d30518c84b7bd6c366c8c8df7b2e7c0ee0f6768", [:mix], [{:phoenix_html, "~> 2.10", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "3041b5e039bf0385b46db329255a453c28ce8e8afde44adb7e946ff66095895c"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.1.0", "a044d0756d0464c5a541b4a0bf4bcaf89bffcaf92468862408290682c73ae50d", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "c5e666a341ff104d0399d8f0e4ff094559b2fde13a5985d4cb5023b2c2ac558b"},
"phoenix_form_awesomplete": {:hex, :phoenix_form_awesomplete, "0.1.5", "d09aade160b584e3428e1e095645482396f17bddda4f566f1118f12d2598d11c", [:mix], [{:phoenix_html, "~> 2.10", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "acef2dbc638b5bcad92c11e41eb2b55d71f2596741a2f936717b8472196456ec"},
"phoenix_html": {:hex, :phoenix_html, "2.14.1", "7dabafadedb552db142aacbd1f11de1c0bbaa247f90c449ca549d5e30bbc66b4", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "536d5200ad37fecfe55b3241d90b7a8c3a2ca60cd012fc065f776324fa9ab0a9"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.2.1", "274a4b07c4adbdd7785d45a8b0bb57634d0b4f45b18d2c508b26c0344bd59b8f", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "41b4103a2fa282cfd747d377233baf213c648fdcc7928f432937676532490eee"},
"phoenix_live_view": {:hex, :phoenix_live_view, "0.11.1", "c9aadf90332f713f3b9cf7ba48883db579eaa24d862adc7ac11a45e58d5efa3c", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.4.16", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "2408e31fc0f355f51e3f3621649fef58fadc6f13a53bb539f41f88b493014456"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm", "1f13f9f0f3e769a667a6b6828d29dec37497a082d195cc52dbef401a9b69bf38"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"},
"plug": {:hex, :plug, "1.10.0", "6508295cbeb4c654860845fb95260737e4a8838d34d115ad76cd487584e2fc4d", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "422a9727e667be1bf5ab1de03be6fa0ad67b775b2d84ed908f3264415ef29d4a"},
"plug_cowboy": {:hex, :plug_cowboy, "2.1.2", "8b0addb5908c5238fac38e442e81b6fcd32788eaa03246b4d55d147c47c5805e", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "7d722581ce865a237e14da6d946f92704101740a256bd13ec91e63c0b122fc70"},
"plug_cowboy": {:hex, :plug_cowboy, "2.1.3", "38999a3e85e39f0e6bdfdf820761abac61edde1632cfebbacc445cdcb6ae1333", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "056f41f814dbb38ea44613e0f613b3b2b2f2c6afce64126e252837669eba84db"},
"plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"},
"postgrex": {:hex, :postgrex, "0.15.3", "5806baa8a19a68c4d07c7a624ccdb9b57e89cbc573f1b98099e3741214746ae4", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "4737ce62a31747b4c63c12b20c62307e51bb4fcd730ca0c32c280991e0606c90"},
"pow": {:hex, :pow, "1.0.19", "e6295de629338661afdc52b3420f1fa37c191d246aef5d844161843fed6fe88b", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.3.0 or ~> 1.4.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, ">= 2.0.0 and <= 3.0.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, ">= 1.5.0 and < 2.0.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "da77fab98e038b39c5360a77dc98e606cdd1446dabdd65a88991e8b23f67a356"},

Loading…
Cancel
Save