Elixir Mentor

Andrew Stewart on LiveView the Do’s and Don’ts

29 snips
Feb 10, 2024
In this engaging conversation, Andrew Stewart, an Elixir developer and educator known for his insightful YouTube content, shares his journey from Ruby to Elixir. He dives into the do’s and don’ts of LiveView, emphasizing its learning curve and best practices for building real-time applications. Andrew highlights the importance of using JS hooks wisely, warns against overusing server roundtrips, and discusses the challenges of handling multiple LiveViews. He also reflects on the ethics of user tracking and the evolving job market in the Elixir community.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Keep UI Interactions Client-Side

  • Avoid putting purely UI interactions (modals, dropdowns) behind LiveView server round trips.
  • Use JS hooks for client-side interactions to reduce latency and bandwidth costs.
INSIGHT

Real-Time Tools Are Overused In Tutorials

  • Many LiveView tutorials jump to PubSub and Presence as flashy features.
  • In practice most apps do not need real-time presence or heavy PubSub wiring.
ADVICE

Favor Function Components Over Stateful Ones

  • Prefer function components for presentational UI and keep state minimal.
  • Use live components sparingly because owning state there creates complex prop-drilling and coordination problems.
Get the Snipd Podcast app to discover more snips from this episode
Get the app