Are one of these LiveView anti patterns lurking in your codebase?
Over the past 3 years of writing LiveView in production, I’ve come across common 4 anti patterns in LiveView applications. They are:
- Improper separation of concerns
- Function head soup
- Not indexing large lists
- Failure to preload LiveComponent assigns
We’ll discuss each, what makes them problematic, and how to remedy them
Repo.stream/2 with no database transaction
Streaming millions of rows with Repo.stream/2
can cause your database to crash. As an alternative, consider using cursor-based pagination.
To make such streaming operations easier to write, we’ve just published a ecto_cursor_based_stream library that exports a Repo.cursor_based_stream/2
function, which has almost the same interface.
Come check it out!
Justin Wood, Query debugging and optimization in Postgres, Denver Elixir Meetup March 2023
Did you miss the Denver Elixir meetup last night? Don’t worry, watch on Youtube - Justin Wood, Query debugging and optimization in Postgres
Thinking Elixir News 141
Episode 141 of Thinking Elixir. We talk with Andrea Leopardi, Elixir core team member, author, and recent Protohacker celebrity! We wanted to learn more about his dbg work that outputs boolean expression info and about his experience using Elixir to solve the Protohacker networking challenges. He shares how that work parlayed into creating an Elixir networking book for PragProg. He teases what he might be working next and more!
ACL checks in LiveView using function decorators
Creating a function decorator for easier security checks in LiveView event handlers: https://www.botsquad.com/2023/03/07/liveview-acl-checks/
What does AI dream about? Stable Diffusion in Elixir
Bumblebee & Stable Diffusion & Phoenix Live View meets in one place! Learn how to create a live prompt generating Stable Diffusion based images in Elixir 😎
Elixir Railway Oriented Programming
I am excited to share my latest article about a powerful pattern for developing in the Elixir programming language Railway Oriented Programming
Introducing lazyasdf: An Elixir-based TUI for the asdf version manager
https://www.mitchellhanberg.com/introducing-lazyasdf-a-tui-for-the-asdf-version-manager/
lazyasdf is my first real* attempt at making a TUI with Elixir!
asdf is normally used through a command line interface (CLI), lazyasdf presents you with a terminal user interface (TUI) for working with asdf.
I recently fell in love with lazygit and have since dreamed of writing my own TUI programs, but with Elixir.
What does AI dream about? Stable Diffusion in Elixir
Tools like ChatGPT and DALL·E2 brought immense interest to AI. Nowadays, the go-to language to work with machine learning and artificial intelligence is Python, but this market share may shift in the future thanks to some new excellent tools created recently in Elixir programming language.
https://curiosum.com/blog/what-does-ai-dream-about-stable-diffusion-in-elixir
Interview with Holden Oullette: Elixir Security, the Sobelow Project, and Scaling Developer Education
Holden Oullette is the new maintainer of Sobelow, and is interested in security education for Elixir developers.
Creating A Frontend Style Guide With Phoenix Components
As we have more pages and new user-interface elements, it was a great time to think about improving our frontend, targeting the reusability of components and code organization. This post explains how we did that with Phoenix Components and the Atomic Design methodology.
https://readyforproduction.dev/blog/frontend-style-guide-with-phoenix-components
Device drivers with Elixir, also Elgato Stream Deck :)
I’ve been experimenting and have had a ton of fun doing so. Wrote up all about it on the blog for the first time in ages. https://underjord.io/userspace-drivers-in-elixir.html
Learn how to install Phoenix (Elixir) with the UI components from Flowbite and Tailwind CSS
Check out this guide to learn how to install Phoenix Framework (Elixir) with the open-source UI component library called Flowbite together with Tailwind CSS.
Thinking Elixir News 140
Episode 140 of Thinking Elixir. Progress report for LiveView Native, Livebook announced an integration with Hugging Face, Andrea Leopardi concludes his series of Protohacker challenge videos, new Phoenix 1.7.0 RCs 3 & 4 released, 3.5 year old issue is solved that unifies Elixir and Erlang loggers, and more!
Elixir/Phoenix Security: Remote Code Execution and Serialisation
Did you know that Elixir functions with an arity of 2 implement the Enumerable protocol? That :erlang.binary_to_term/2 is not always safe? Learn more in this new post!
An Introduction to Test Factories and Fixtures for Elixir
In the first part of this three-part series, we’ll give an overview of Elixir test factories and fixtures: https://blog.appsignal.com/2023/02/28/an-introduction-to-test-factories-and-fixtures-for-elixir.html
The 3 features that will make you fall for Elixir
With this article, we want to share the features that led us to become Elixir superfans, so that you can appreciate how elegant and efficient this language is. https://medium.com/wttj-tech/the-3-features-that-will-make-you-fall-for-elixir-598c9a31172d
Phoenix Dev Blog - Streams
“Streams” is the latest addition to Phoenix LiveView! Chris McCord wrote a “Dev Blog” about it, shining a light on the problem it solves and shares some insight into how it works. It’s a super elegant solution to a complex problem and can even reduce memory on the server!