chrismccord

chrismccord

Creator of Phoenix

Phoenix v1.5.0 released!

This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There have been a few deprecations, but this ugprade should be quick and easy for most folks.

Phoenix LiveDashboard

On the heels of the official LiveDashboard release, Phoenix 1.5 projects now ship with LiveDashboard by default, for real-time performance monitoring and debugging tools. It’s at this point I also want to re-welome Michael Crumm to the phoenix-core team! He has been heading up the Dashboard work with José, and we can thank them both for the amazing results we have today.

The Dashboard brings you immediate insight into your Phoenix applications with focus on production data. Even if you are just starting with Phoenix, we have tooltips on the widgets so you can learn more about them and if/when you should worry about system limits and the health of your system. With telemetry integration, we also include charting of Phoenix events, along with user-defined metrics.

Check José’s twitter thread to see a breakdown of features and screenshots:
https://twitter.com/josevalim/status/1250846714665357315

The dashboard also includes is also a streaming request logger. This is super convenient for diagnosing an issue in production where you need logs for specific requests but the regular logs drown out your requests in noise. With a button click, you can have all of your own request logs streamed to the dashboard instead of sifting thru a flood of production logs.

We also include a process tab, which is similar to observer, allowing you to sort processes in the system to find large message queues, memory hogs, etc.

Did we mention this Just Works™ for a cluster of distributed nodes? :slight_smile: Using the node drop-down selector, you can access all the data/features listed above for any node on the cluster, regardless of what web node you happened to load-balance to when loading the dashboard.

Phoenix LiveView generators

The phx.new project generator now includes a --live flag to include everything you need to get up and running developing with LiveView. Additionally, we have also added a phx.gen.live generator for boostrapping CRUD LiveView context/interfaces similar to phx.gen.html. We recommend taking these generators for a test drive to see all the existing improvements to LiveView that recently shipped:

  • Revamped LiveViewTest APIs for more powerful, workflow driven testing
  • Deep diff tracking for LiveView templates, dramatically reducing server payloads in many cases
  • Large performance improvements on client rendering
  • Live Navigation with Live Flash

PubSub 2.0

Phoenix.PubSub 2.0 has been released with a more flexible and powerful fastlane mechanism. We took this opportunity to also move Phoenix.PubSub out of the endpoint and explicitly into your supervision tree. This prevents race conditions at startup and decouples your PubSub system from the endpoint. Follow the upgrade guides linked below to get up to speed.

Revamped Guides

Thanks to efforts by @josevalim, the Phoenix built-in guides have been restructured and revamped, providing a better navigation structure and more content. Be sure to take a look if you’d like to freshen up on your phoenix knowledge.

Other notable improvements include built-in support for MSSQL databases via the tds adapter, and inclusion of the Phoenix.Ecto.CheckRepoStatus plug in new projects to detect and prompt for database creation/migration on new requests.

As always, we have provided upgrade guides to bring your existing applications up to speed:

Find us on elixir slack/irc if you have questions. Happy coding!

–Chris

Full changelog:

1.5.0

Enhancements

  • [Channel] Do not block the channel supervisor on join
  • [ConnTest] Add init_test_session to Phoenix.ConnTest
  • [Controller] Support :disposition option in send_download/3
  • [Endpoint] Allow named params to be used when defining socket paths
  • [Endpoint] Raise if force_ssl has changed from compile time to runtime
  • [Generator] Add mix phx.gen.live for LiveView CRUD generation
  • [PubSub] Migrate to PubSub 2.0 with a more flexible fastlaning mechanism
  • [View] Add render_layout which makes it easy to work with nested layouts
  • [Transport] Transports can now optionally implement handle_control/2 for handling control frames such as :ping and :pong

Deprecations

  • [ChannelTest] use Phoenix.ChannelTest is deprecated in favor of import Phoenix.ChannelTest
  • [ConnTest] use Phoenix.ConnTest is deprecated in favor of import Plug.Conn; import Phoenix.ConnTest
  • [Endpoint] The outdated Phoenix.Endpoint.CowboyAdapter for Cowboy 1 is deprecated. Please make sure {:plug_cowboy, "~> 2.1"} or later is listed in your mix.exs
  • [Endpoint] subscribe and unsubscribe via the endpoint is deprecated, please use Phoenix.PubSub directly instead
  • [Endpoint] Phoenix.Endpoint.instrument/4 is deprecated and has no effect. Use :telemetry instead. See Phoenix.Logger for more information
  • [Endpoint] The :pubsub key for endpoint is deprecated. Once you start your app, you will see step-by-step instructions on how to use the new PubSub config
  • [Layout] Use <%= @inner_content %> instead of <%= render @view_module, @view_template, assigns %> for rendering the child layout

phx.new installer

  • Built-in support for MSSQL databases via the tds adapter
  • Phoenix.PubSub is now started directly in your application supervision tree
  • Phoenix.Ecto.CheckRepoStatus is now added to new applications that use Ecto
  • Automatically use System.get_env("MIX_TEST_PARTITION") in the database name in the test environemnt for built-in CI test partitioning
  • Generate a MyApp.Telemetry module with examples of Telemetry Metrics you may want to track in your app
  • Support the --live flag for generating apps with out-of-the-box LiveView support

JavaScript client

  • Ensure all channel event listeners are called
  • Fix rejoining channels after explicit disconnect following be immediate reconnect
  • Prevent duplicate join race conditions by immediately leaving duplicate channel on client

Most Liked

shuaib

shuaib

Wow… This excites me a lot. LiveDashboard and –live… time to harass my React friends :smiley:

22
Post #4
josevalim

josevalim

Creator of Elixir

We all want the installation steps to be more succinct - but unfortunately we can’t because of npm+windows - even though many users were reporting this particular combination was fine.

Please debug the npm issue and send pull requests so the --prefix works as expected.


I think people underestimate how hard this kind of stuff is on Windows. Today I spent most of my day adding coloring support to IEx and ExUnit on Windows and I had to test it on:

  1. Console
  2. Powershell
  3. Linux subsystem
  4. Mingw

And now there is a Windows Terminal - which is unfortunately gated behind a Windows Insider program. I could not install it at the end, even though there are already users requesting the Elixir team to support it.

At this point, I am sure there are specific combinations that I was not able to test the coloring properly and some will still take this as “lack of interest” in supporting Windows, despite the tremendous amount of effort put when implementing this feature compared to other platforms.

chrismccord

chrismccord

Creator of Phoenix

You can conditionally call the plug :slight_smile:

  if code_reloading? do
    socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
-   plug Phoenix.LiveReloader
+   plug :live_reloader, exclude: ["/dashboard"]
    plug Phoenix.CodeReloader
    plug Phoenix.Ecto.CheckRepoStatus, otp_app: :drive_in
  end

+ defp live_reloader(conn, exclude: excludes) do
+   if conn.path_info in excludes do
+     conn
+   else
+     Phoenix.LiveReloader.call(conn, Phoenix.LiveReloader.init([]))
+   end
+ end

Where Next?

Popular in Phoenix News Top

steffend
LiveView 1.2.0 is out now! Colocated CSS The biggest new feature is support for Colocated CSS, which is built on the work we did in 1.1 ...
New
chrismccord
A minor vulnerability has been disclosed for applications redirecting to URLs provided by user input. Only applications passing user inpu...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
chrismccord
Phoenix 1.3.5, 1.4.18, 1.5.14, and 1.6.14 have been released to resolve a vulnerability in wildcard check_origin configurations. Previou...
New
chrismccord
You can read the announcement on the blog, but I’ll dup most of it here for discussion purposes: ––––––––––––––––––––––––––––––––––––––...
451 13951 109
New
chrismccord
Announcement post dup’d here for convenience: Phoenix 1.7.2 is out! This minor release includes a couple features worth talking about. ...
New
chrismccord
LiveView 1.0.0-rc.0 is out! This 1.0 milestone comes almost six years after the first LiveView commit. I published a Phoenix blog highli...
New
chrismccord
I’m pleased to announce the first release candidate of Phoenix 1.6.0 has landed on the heels of a fresh LiveView 0.16 release! This relea...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New

We're in Beta

About us Mission Statement