See the upgrade guides to bring your Phoenix 1.4.x apps up to speed
Phoenix.PubSub 2.0 has been released with a more flexible and powerful fastlane mechanism. We use this opportunity to also move Phoenix.PubSub out of the endpoint and explicitly into your supervision tree. To update, you will need to remove or update the {:phoenix_pubsub, "~> 1.x"} entry in your mix.exs to at least 2.0.
Then once you start an application, you will get a warning about the :pubsub key in your endpoint being deprecated. Follow the steps in the warning and you are good to go!
Phoenix built-in guides have been restructured and revamped, providing a better navigation structure and more content.
- [View] Do not render root layout outside of layout formats
- [Channel] Push proper close event to client on duplicate topic shutdown
- Schedule heartbeat on reply to avoid intensive throttling
- Fire each event in a separate task for the LongPoll transport to fix ordering
- Bind to
beforeunloadinstead ofunloadto solve Firefox connection issues
- [Endpoint] - Add
:log_access_urlconfig to endpoint start - [Router] - Include route information in router_dispatch exception for telemetry events
- [Router] - Optimize router code generation to reduce compilation dependencies
- [phx.new] - Use topbar in new apps with the --live flag
- Default channel
pushpayload to empty object for backwards compatibility
- [Channel] - Add binary serialization support to default serializers
- Add binary serialization support to default serializers for ability to push
ArrayBufferobjects as binary WebSocket frames
- [phx.new] Add --install and --no-install options to phx.new
- [phx.new] Update
phoenix_live_dashboardrequirement to fix version conflicts
- [Phoenix.Logger] Add :conn to
[:phoenix, :router_dispatch, :exception]events - [Phoenix.Endpoint] Use regex to detect invalid hosts for IPv6 configurations
- [Phoenix.Controller] Don't create compile-time references when using
action_fallbackto speed up compilation - [Phoenix.Endpoint] Expose
:connect_info:trace_context_headersin websockets and long polling
- [Phoenix.Endpoint] Include
:connin[:phoenix, :error_rendered]event - [Phoenix.Endpoint] Warn if the
url.hostprovided for the endpoint is invalid - [Phoenix.Router] Log when router plugs halt
- Fix warnings on Elixir v1.11
- [Phoenix.Router] Rename the
[:phoenix, :router_dispatch, :exception]metadata from:errorto:reasonto match the documentation and the telemetry specification (:erroris still emitted for compatibility but it will be fully removed on v1.6)
- [phx.new] - Fix incompatible LiveView version for newly generated projects
- [Channel] Import
assigns: 2on channels - [Endpoint] Track latest static in
config(:cache_static_manifest_latest) - [Endpoint] Allow
:user_agentonconnect_info
- [Endpoint] Undeprecate
subscribeandunsubscribein the endpoint
- [Endpoint] Ignore the root layout on error pages unless explicitly set
- [Channel] Do not block the channel supervisor on join
- [ConnTest] Add
init_test_sessionto Phoenix.ConnTest - [Controller] Support
:dispositionoption insend_download/3 - [Endpoint] Automatically perform connection draining when shutting down the VM
- [Endpoint] Allow named params to be used when defining socket paths
- [Endpoint] Raise if
force_sslhas changed from compile time to runtime - [Generator] Add
mix phx.gen.livefor LiveView CRUD generation - [PubSub] Migrate to PubSub 2.0 with a more flexible fastlaning mechanism
- [View] Add
render_layoutwhich makes it easy to work with nested layouts - [View] Raise if
assignsargument to functionsrender/3,render_existing/3,render_many/4,render_one/4,render_layout/4,render_to_iodata/3,render_to_string/4is a struct - [Transport] Transports can now optionally implement
handle_control/2for handling control frames such as:pingand:pong
- [ChannelTest]
use Phoenix.ChannelTestis deprecated in favor ofimport Phoenix.ChannelTest - [ConnTest]
use Phoenix.ConnTestis deprecated in favor ofimport Plug.Conn; import Phoenix.ConnTest - [Endpoint] The outdated
Phoenix.Endpoint.CowboyAdapterfor Cowboy 1 is deprecated. Please make sure{:plug_cowboy, "~> 2.1"}or later is listed in yourmix.exs. - [Endpoint]
Phoenix.Endpoint.instrument/4is deprecated and has no effect. Use:telemetryinstead. SeePhoenix.Loggerfor more information. - [Endpoint] The
:pubsubkey 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
- Built-in support for MSSQL databases via
Ecto.Adapters.Tds Phoenix.PubSubis now started directly in your application supervision treePhoenix.Ecto.CheckRepoStatusis now added to new applications that use Ecto- Automatically use
System.get_env("MIX_TEST_PARTITION")in the database name in the test environment for built-in CI test partitioning - Generate a
MyApp.Telemetrymodule with examples of Telemetry Metrics you may want to track in your app - Support the
--liveflag for generating apps with out-of-the-box LiveView support - Include SCSS support by default when using webpack
- 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
The CHANGELOG for v1.4 releases can be found in the v1.4 branch.