The Wire · Showcase
LiveView memory leak fix leads overnight Elixir cleanup
By RepoJournal · Filed · About Elixir & Phoenix
A handful of pull requests across Elixir and Phoenix are quietly fixing leaks and edge cases that have been nagging at production apps.
The standout is a memory leak fix in Phoenix LiveView that clears the focus stack on view teardown and live navigation [1]. Any push_focus without a matching pop_focus now releases its detached element, so long-lived LiveView apps stop growing in memory. In the same repo, a fix for a missing return after child join failure [2] prevents destroy() from being called twice and errors from being shown on destroyed views, while another patch ensures join completion still fires callbacks when recovery markup is empty [3]. Over in elixir-lang, PR #15767 removes an intermediate list in elixir_interpolation's hex_to_int [4], saving a slice of compile-time work. That PR's author, dkuku, says "list_to_integer can be removed" in one more spot [5], a follow-up to their earlier cleanup. Meanwhile, File.cp and File.cp_r get a performance boost by using chmod instead of stat and write_stat [6], cutting a file-server round trip per copy. And Phoenix docs are finally getting a Markdown formatter, following ExDoc's new default, with the PR noting "Phoenix already resolves ExDoc 0.40.3, but its explicit formatter list prevents that new default from applying" [7].
One email a day. Unsubscribe in one click.
Keep up with Elixir & Phoenix in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Pull the LiveView focus stack fix and child join fixes into your app phoenixframework/phoenix_live_view [immediate]
- → Upgrade to Elixir main to pick up the hex_to_int and file copy optimizations elixir-lang/elixir [monitor]
- → Keep an eye on the Phoenix docs Markdown formatter PR for the next release phoenixframework/phoenix [monitor]
References
- [1] Clear focus stack entries on view teardown ↗ phoenixframework/phoenix_live_view
- [2] Fix missing return after child join failure ↗ phoenixframework/phoenix_live_view
- [3] Fix join completion for empty recovery markup (#4390) phoenixframework/phoenix_live_view
- [4] Remove intermediate list in elixir_interpolation hex_to_int (#15767) elixir-lang/elixir
- [5] Remove intermediate list in elixir_interpolation hex_to_int ↗ elixir-lang/elixir
- [6] perf: Copy file mode with chmod instead of stat and write_stat ↗ elixir-lang/elixir
- [7] Add markdown formatter to docs output ↗ phoenixframework/phoenix