Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Phoenix 1.4.0 is out with ‘Presence javascript API', HTTP2 support, and more!

Save for later
  • 2 min read
  • 08 Nov 2018

article-image

Yesterday, the Phoenix web framework announced the release of its latest version, Phoenix 1.4. This release includes new features such as an HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. The community also shipped a new and improved Presence javascript API.

Features in the Phoenix 1.4.0

phx_new archive via hex


The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience. The existing Phoenix applications will continue to work on Elixir 1.4. However, the new phx.new archive requires Elixir 1.5+.

Support HTTP2 by making a small change


Thanks to the release of Cowboy 2, Phoenix 1.4 supports HTTP2 with a single line change to mix.exs. One needs to simply add {:plug_cowboy, "~> 2.0"} to their deps and Phoenix will run with the Cowboy 2 adapter.

New phx.gen.cert to aid local SSL development


Most browsers require connections over SSL for HTTP2 requests, failure of which can cause them to fallback to HTTP 1.1 requests. To aid local development over SSL, Phoenix now includes a new phx.gen.cert task which generates a self-signed certificate for HTTPS testing in development.

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at ₹800/month. Cancel anytime

Faster Development Compilation


The new release has improved compilation speeds have improved due to the contributions to plug and compile-time changes.

New Development 404 Page


Phoenix’s 404 page (in development) now lists the available routes for the originating router, for example:

phoenix-1-4-0-is-out-with-presence-javascript-api-http2-support-and-more-img-0

A new UserSocket for connection info


Access to more underlying transport information when using Phoenix channels has been a highly requested feature. The 1.4 release now provides a connect/3 UserSocket callback, which can provide connection information, such as the peer IP address, host information, and X-Headers of the HTTP request for WebSocket and Long-poll transports.

New  ‘Presence JavaScript API’


A new, backward compatible Presence JavaScript API has been introduced to both resolve race conditions as well as simplify the usage. Previously, multiple channel callbacks against "presence_state” and "presence_diff" events were required on the client which dispatched to Presence.syncState and Presence.syncDiff functions. Now, the interface has been unified to a single onSync callback and the presence object tracks its own channel callbacks and state.

To know more about Phoenix 1.4.0 visit its official website.

Mojolicious 8.0, a web framework for Perl, released with new Promises and Roles

Web Framework Behavior Tuning

Beating jQuery: Making a Web Framework Worth its Weight in Code