Why changes in Phoenix 1.3 are so important?

Nikita Sobolev
May 14, 2017 · 7 min read
Image for post
Image for post

Problems to solve

Old boilerplate code

Solutions

» mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
mix phoenix.new       # Creates a new Phoenix v1.1.4 applicationmix phx.new           # Creates a new Phoenix v1.3.0-rc.1 application using the experimental generators
mix phx.new medium_phx_example --no-html --no-brunch

Changes

lib
└── medium_phx_example
├── application.ex
├── repo.ex
└── web
├── channels
│ └── user_socket.ex
├── controllers
├── endpoint.ex
├── gettext.ex
├── router.ex
├── views
│ ├── error_helpers.ex
│ └── error_view.ex
└── web.ex
Example of web.ex
» mix phx.gen.json Audio Album albums name:string release:utc_datetime» mix phx.gen.json Audio Song songs album_id:references:audio_albums name:string duration:integer
lib
└── medium_phx_example
├── application.ex
├── audio
│ ├── album.ex
│ ├── audio.ex
│ └── song.ex
├── repo.ex
└── web
├── channels
│ └── user_socket.ex
├── controllers
│ ├── album_controller.ex
│ ├── fallback_controller.ex
│ └── song_controller.ex
├── endpoint.ex
├── gettext.ex
├── router.ex
├── views
│ ├── album_view.ex
│ ├── changeset_view.ex
│ ├── error_helpers.ex
│ ├── error_view.ex
│ └── song_view.ex
└── web.ex
album.ex
song.ex
audio.ex
New boilerplate code
fallback_controller.ex

Conclusion

wemake.services

We love Python and Elixir. We use Javascript.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store