Packages
phoenix_live_view
0.5.2
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.2.0-rc.3
1.2.0-rc.2
1.2.0-rc.1
1.2.0-rc.0
1.1.32
1.1.31
1.1.30
1.1.29
1.1.28
1.1.27
1.1.26
1.1.25
1.1.24
1.1.23
1.1.22
1.1.21
1.1.20
1.1.19
1.1.18
1.1.17
1.1.16
1.1.15
1.1.14
1.1.13
1.1.12
1.1.11
1.1.10
1.1.9
1.1.8
1.1.7
1.1.6
retired
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.1.0-rc.4
1.1.0-rc.3
1.1.0-rc.2
1.1.0-rc.1
1.1.0-rc.0
1.0.18
1.0.17
1.0.16
1.0.15
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
retired
1.0.7
1.0.6
retired
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
1.0.0-rc.9
1.0.0-rc.8
1.0.0-rc.7
1.0.0-rc.6
1.0.0-rc.5
1.0.0-rc.4
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
1.0.0-rc.0
0.20.17
0.20.16
0.20.15
0.20.14
0.20.13
0.20.12
0.20.11
0.20.10
0.20.9
0.20.8
0.20.7
0.20.6
0.20.5
0.20.4
0.20.3
0.20.2
0.20.1
0.20.0
0.19.5
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.18
0.18.17
0.18.16
0.18.15
0.18.14
0.18.13
0.18.12
0.18.11
0.18.10
0.18.9
0.18.8
0.18.7
0.18.6
0.18.5
0.18.4
0.18.3
0.18.2
0.18.1
0.18.0
0.17.14
0.17.13
0.17.12
0.17.11
0.17.10
0.17.9
0.17.8
0.17.7
0.17.6
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.7
0.15.6
0.15.5
0.15.4
0.15.3
0.15.2
0.15.1
0.15.0
0.14.8
0.14.7
0.14.6
0.14.5
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.13.3
0.13.2
0.13.1
0.13.0
0.12.1
0.12.0
0.11.1
0.11.0
0.10.0
0.9.0
0.8.1
0.8.0
0.7.1
0.7.0
0.6.0
0.6.0-dev
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.1
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0
Rich, real-time user experiences with server-rendered HTML
Current section
Files
Jump to
Current section
Files
phoenix_live_view
CHANGELOG.md
CHANGELOG.md
## 0.5.2 (2020-01-17)
### Bug Fixes
- Fix optimization bug causing some DOM nodes to be removed on updates
## 0.5.1 (2020-01-15)
### Bug Fixes
- Fix phx-change bug causing phx-target to not be used
## 0.5.0 (2020-01-15)
LiveView now makes the connection session automatically available in LiveViews. However, to do so, you need to configure your endpoint accordingly, **otherwise LiveView will fail to connect**.
The steps are:
1) Find `plug Plug.Session, ...` in your endpoint.ex and move the options `...` to a module attribute:
@session_options [
...
]
2) Change the `plug Plug.Session` to use said attribute:
plug Plug.Session, @session_options
3) Also pass the `@session_options` to your LiveView socket:
socket "/live", Phoenix.LiveView.Socket,
websocket: [connect_info: [session: @session_options]]
4) You should define the CSRF meta tag inside the in <head> in your layout:
<%= csrf_meta_tag() %>
5) Then in your app.js:
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content");
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}});
Also note that **the session from now on will have string keys**. LiveView will warn if atom keys are used.
### Enhancements
- Respect new tab behavior in `live_link`
- Add `beforeUpdate` and `beforeDestroy` JS hooks
- Make all assigns defined on the socket mount available on the layout on first render
- Provide support for live layouts with new `:layout` option
- Detect duplicate IDs on the front-end when DEBUG mode is enabled
- Automatically forward the session to LiveView
- Support "live_socket_id" session key for identifying (and disconnecting) LiveView sockets
- Add support for `hibernate_after` on LiveView processes
- Support redirecting to full URLs on `live_redirect` and `redirect`
- Add `offsetX` and `offsetY` to click event metadata
- Allow `live_link` and `live_redirect` to exist anywhere in the page and it will always target the main LiveView (the one defined at the router)
### Backwards incompatible changes
- `phx-target="window"` has been removed in favor of `phx-window-keydown`, `phx-window-focus`, etc, and the `phx-target` binding has been repurposed for targetting LiveView and LiveComponent events from the client
- `Phoenix.LiveView` no longer defined `live_render` and `live_link`. These functions have been moved to `Phoenix.LiveView.Helpers` which can now be fully imported in your views. In other words, replace `import Phoenix.LiveView, only: [live_render: ..., live_link: ...]` by `import Phoenix.LiveView.Helpers`
## 0.4.1 (2019-11-07)
### Bug Fixes
- Fix bug causing blurred inputs
## 0.4.0 (2019-11-07)
### Enhancements
- Add `Phoenix.LiveComponent` to compartmentalize state, markup, and events in LiveView
- Handle outdated clients by refreshing the page with jitter when a valid, but outdated session is detected
- Only dispatch live link clicks to router LiveView
- Refresh the page for graceful error recovery on failed mount when the socket is in a connected state
### Bug Fixes
- Fix `phx-hook` destroyed callback failing to be called in certain cases
- Fix back/forward bug causing LiveView to fail to remount
## 0.3.1 (2019-09-23)
### Backwards incompatible changes
- `live_isolated` in tests no longer requires a router and a pipeline (it now expects only 3 arguments)
- Raise if `handle_params` is used on a non-router LiveView
### Bug Fixes
- [LiveViewTest] Fix function clause errors caused by HTML comments
## 0.3.0 (2019-09-19)
### Enhancements
- Add `phx-debounce` and `phx-throttle` bindings to rate limit events
### Backwards incompatible changes
- IE11 support now requires two additional polyfills, `mdn-polyfills/CustomEvent` and `mdn-polyfills/String.prototype.startsWith`
### Bug Fixes
- Fix IE11 support caused by unsupported `getAttributeNames` lookup
- Fix Floki dependency compilation warnings
## 0.2.1 (2019-09-17)
### Bug Fixes
- [LiveView.Router] Fix module concat failing to build correct layout module when using custom namespace
- [LiveViewTest] Fix `phx-update` append/prepend containers not building proper DOM content
- [LiveViewTest] Fix `phx-update` append/prepend containers not updating existing child containers with matching IDs
## 0.2.0 (2019-09-12)
### Enhancements
- [LiveView] Add new `:container` option to `use Phoenix.LiveView`
- [LiveViewTest] Add `live_isolated` test helper for testing LiveViews which are not routable
### Backwards incompatible changes
- Replace `configure_temporary_assigns/2` with 3-tuple mount return, supporting a `:temporary_assigns` key
- Do not allow `redirect`/`live_redirect` on mount nor in child live views
- All `phx-update` containers now require a unique ID
- `LiveSocket` JavaScript constructor now requires explicit dependency injection of Phoenix Socket constructor. For example:
```javascript
import {Socket} from "phoenix"
import LiveSocket from "phoenix_live_view"
let liveSocket = new LiveSocket("/live", Socket, {...})
```
### Bug Fixes
- Fix `phx-update=append/prepend` failing to join new nested live views or wire up new phx-hooks
- Fix number input handling causing some browsers to reset form fields on invalid inputs
- Fix multi-select decoding causing server error
- Fix multi-select change tracking failing to submit an event when a value is deselected
- Fix live redirect loop triggered under certain scenarios
- Fix params failing to update on re-mounts after live_redirect
- Fix blur event metadata being sent with type of `"focus"`
## 0.1.2
### Backwards incompatible changes
- `phx-value` has no effect, use `phx-value-*` instead
- The `:path_params` key in session has no effect (use `handle_params` in `LiveView` instead)
## 0.1.1 (2019-08-27)
### Enhancements
- Use optimized `insertAdjacentHTML` for faster append/prepend and proper css animation handling
- Allow for replacing previously appended/prepended elements by replacing duplicate IDs during append/prepend instead of adding new DOM nodes
### Bug Fixes
- Fix duplicate append/prepend updates when parent content is updated
- Fix JS hooks not being applied for appending and prepended content
## 0.1.0 (2019-08-25)
### Enhancements
- The LiveView `handle_in/3` callback now receives a map of metadata about the client event
- For `phx-change` events, `handle_in/3` now receives a `"_target"` param representing the keyspace of the form input name which triggered the change
- Multiple values may be provided for any phx binding by using the `phx-value-` prefix, such as `phx-value-myval1`, `phx-value-myval2`, etc
- Add control over the DOM patching via `phx-update`, which can be set to `"replace"`, `"append"`, `"prepend"` or `"ignore"`
### Backwards incompatible changes
- `phx-ignore` was renamed to `phx-update="ignore"`