$ the-wire · showcase
LiveView async fixes, Elixir docs gains
By RepoJournal · Filed · About Elixir & Phoenix
Phoenix LiveView tightened its async handling with three fixes for correctness and allocation, while Elixir landed small documentation improvements.
Phoenix LiveView addressed three issues around async assignments and PIDs [1] [2] [3]. Assign async validation now handles falsy keys correctly, which used to allow keys like `false` or `nil` to slip through; it now rejects them. The call to get async PIDs now uses `:infinity` as the timeout, matching the existing default in the call helper and preventing unexpected timeouts. Also, the `async/1` machinery avoids allocating unused PID metadata, cutting work for the common case where that metadata isn't needed. No breaking changes; all three are safe to pick up.
On the Elixir side, the docs for `Kernel.defstruct` got a corrected example [4], and the `--partitions` documentation now links to the relevant sections [5], making the docs easier to navigate. A fix also guarantees that a binary may always be returned from a comprehension [6], resolving an inconsistency in the language's behavior.
Action items
- → Update phoenix_live_view to a version containing these async fixes before your next deploy phoenixframework/phoenix_live_view [plan]
References
- [1] Use :infinity as timeout when getting async pids ↗ phoenixframework/phoenix_live_view
- [2] Handle falsy keys in assign_async validation (#4432) ↗ phoenixframework/phoenix_live_view
- [3] Avoid allocating unused async PID metadata (#4426) ↗ phoenixframework/phoenix_live_view
- [4] Fix kernel defstruct doc example (#15867) ↗ elixir-lang/elixir
- [5] Link the relevant docs from `--partitions` docs (#15865) ↗ elixir-lang/elixir
- [6] A binary may always be returned in a comprehension, closes #15857 ↗ elixir-lang/elixir