Freitag, 7. September 2018

Using upcoming versions of Phoenix framework

How to create new projects using an upcoming version of the Phoenix Framework? Right now, 1.3 is the current stable version that is released and when using mix phx.new the project it creates will use 1.3.

The upcoming version 1.4 is certainly stable enough to play around with, but how to create a new project using it? Here are the steps:

➤ mix archive.uninstall phx_new
Are you sure you want to uninstall /Users/steffen/.mix/archives/phx_new? [Yn]

 git clone https://github.com/phoenixframework/phoenix
 cd phoenix/installer

➤ MIX_ENV=prod mix do archive.build, archive.install
Compiling 10 files (.ex)
Generated phx_new app
Generated archive "phx_new-1.4.0-dev.ez" with MIX_ENV=prod
Are you sure you want to install "phx_new-1.4.0-dev.ez"? [Yn]
* creating /Users/steffen/.mix/archives/phx_new-1.4.0-dev

Creating a new project with the development version of phoenix:

➤ mix phx.new asdf
➤ cat asdf/mix.exs
...
  defp deps do
    [
      {:phoenix, github: "phoenixframework/phoenix", override: true},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 3.2"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:cowboy, "~> 1.0"}
    ]
  end
...

Keine Kommentare:

Kommentar veröffentlichen