Repository navigation
v0.9 #193
ogrodnek
announced in
Announcements
v0.9
#193
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
PyView 0.9
The main things in this release are: dependency injection, flash messages, and a complete JS command API.
Dependency Injection with Depends()
Inspired by FastAPI, you can now inject services, auth, etc. into your LiveView methods
Works in
__init__,mount,handle_params,handle_event, and@eventhandlers. Sync or async, with per-request caching so a dependency resolves once and is reused everywhere.Note, it's not yet implemented for LiveComponents
Flash Messages
put_flashandclear_flashon the socket primitives for toasts, save confirmations, and validation errors.Complete JS Command API
The js API now covers the full Phoenix.js command set: attribute manipulation (
set_attribute,remove_attribute,toggle_attribute),toggle_class, client-side navigation (navigate,patch), focus-stack management (push_focus,pop_focus), andexec.Breaking Change: route registration takes classes
Routes now require a LiveView class as part of the work on adding
Dependssupport. Previously while it was normal to use a class, you could pass a factory:Fixes
push_eventcalls duringhandle_infoare now delivered to the browser (#141, thanks @avilior!)This discussion was created from the release v0.9.
All reactions