{"_id":"55d4c93b5082980d0009c790","tags":[],"__v":0,"initVersion":{"_id":"55d447087789b50d00f696fe","version":"0.17.0"},"project":"54348ec95b10711400c6c445","user":{"_id":"5435e00ad7d8700800bbec51","username":"","name":"Jason Stiebs"},"createdAt":"2015-08-19T18:21:47.559Z","changelog":[],"body":"## Deps\n\nBump your `:phoenix` and `:phoenix_live_reload` deps in `mix.exs`:\n\n```elixir\ndef deps do\n  [...\n   {:phoenix, \"~> 0.17\"},\n   {:phoenix_live_reload, \"~> 1.0\"},\n  ...]\nend\n```\n\n## Endpoint\n\nThe `:render_errors: [default_format: \"html\"]` is deprecated in favor of `render_errors: [accepts: [\"html\"]]`. Update your deprecated references in `config/*.exs`\n\n`plug :router` is no longer needed and has been removed. Update your `plug :router, Myapp.Router` to `plug Myapp.Router`.\n\n\n## Controller\n\nThe \"format\" param for overriding the accept header has been renamed to \"\\_format\" and is no longer injected into the params when parsing the Accept headers. Use `get_format/1` to access the negotiated format. If you were relying on the format param being present to match in the controller, such as:\n\n```elixir\ndef show(conn, %{\"id\" => id, \"format\" => \"html\"}) do ...\n```\n\nYou can still support this style by using a simple plug to place the format param. For example:\n\n```elixir\ndefmodule MyApp.Router do\n\n  pipeline :browser do\n    ...\n    plug :put_format_param\n  end\n  \n  ...\n  defp put_format_param(conn, _) do\n    put_in conn.params[\"_format\"], Phoenix.Controller.get_format(conn)\n  end\nend\n```\n\n## ChannelTest\n\nIn order to test channels, one must now explicitly create a socket and pass it to subscribe_and_join. For example,\n\n    subscribe_and_join(MyChannel, \"my_topic\")\n    \nshould now become\n\n```elixir\nsocket() |> subscribe_and_join(MyChannel, \"my_topic\")\n# or\nsocket(\"user:id\", %{user_id: 13}) |> subscribe_and_join(MyChannel, \"my_topic\")\n```\n\nThis pairs nicely with testing the UserSocket by simply call the module directly, for exampe:\n\n```elixir\n{:ok, _, socket} =\n  UserSocket.connect(%{\"some\" => \"params\"}, socket())\n  |> subscribe_and_join(RoomChannel, \"rooms:lobby\", %{\"id\" => 3})\n```\n\nSource: https://gist.github.com/chrismccord/ee5ae90b949a9768b871","slug":"upgrading-from-v016-to-v017","title":"Upgrading from v0.16 to v0.17"}

Upgrading from v0.16 to v0.17


## Deps Bump your `:phoenix` and `:phoenix_live_reload` deps in `mix.exs`: ```elixir def deps do [... {:phoenix, "~> 0.17"}, {:phoenix_live_reload, "~> 1.0"}, ...] end ``` ## Endpoint The `:render_errors: [default_format: "html"]` is deprecated in favor of `render_errors: [accepts: ["html"]]`. Update your deprecated references in `config/*.exs` `plug :router` is no longer needed and has been removed. Update your `plug :router, Myapp.Router` to `plug Myapp.Router`. ## Controller The "format" param for overriding the accept header has been renamed to "\_format" and is no longer injected into the params when parsing the Accept headers. Use `get_format/1` to access the negotiated format. If you were relying on the format param being present to match in the controller, such as: ```elixir def show(conn, %{"id" => id, "format" => "html"}) do ... ``` You can still support this style by using a simple plug to place the format param. For example: ```elixir defmodule MyApp.Router do pipeline :browser do ... plug :put_format_param end ... defp put_format_param(conn, _) do put_in conn.params["_format"], Phoenix.Controller.get_format(conn) end end ``` ## ChannelTest In order to test channels, one must now explicitly create a socket and pass it to subscribe_and_join. For example, subscribe_and_join(MyChannel, "my_topic") should now become ```elixir socket() |> subscribe_and_join(MyChannel, "my_topic") # or socket("user:id", %{user_id: 13}) |> subscribe_and_join(MyChannel, "my_topic") ``` This pairs nicely with testing the UserSocket by simply call the module directly, for exampe: ```elixir {:ok, _, socket} = UserSocket.connect(%{"some" => "params"}, socket()) |> subscribe_and_join(RoomChannel, "rooms:lobby", %{"id" => 3}) ``` Source: https://gist.github.com/chrismccord/ee5ae90b949a9768b871