Upward.Transformers.PhoenixLiveViewTransformer (upward v0.0.6)

View Source

An appup transformer for Phoenix LiveView.

If this transformer is included, it will append instructions to have all Phoenix LiveView channels updated.

If you want your LiveView to be updated during an upgrade/downgrade, you should implement code_change/3 in your LiveView.

def code_change(_old_vsn, socket, _extra) do
  {:ok, socket}
end

old_vsn will be the previous version of the Channel (not the LiveView) and {down: old_vsn} during a downgrade. Because the version is the version of the Channel, you should implement your own version tracking within the socket private or assigns.

Add this transform to the auto_appup step in your release config

def releases do
  [
    my_app: [
      include_executables_for: [:unix],
      steps: [
        :assemble,
        &Upward.auto_appup(&1, transforms: [Upward.Transformers.PhoenixLiveViewTransformer]),
        :tar
      ]
    ]
  ]
end

Summary

Functions

down(app, v1, v2, instructions, opts)

up(app, v1, v2, instructions, opts)