ThinkingElixir 142: Orion for Distributed Tracing in Production

Episode 142 of Thinking Elixir. Orion is an interesting library created by Thomas Depierre that makes it easy to run dynamic distributed tracing in your app on production! It includes a LiveView UI for visualizing the performance and running multiple traces simultaneously. We talk with Thomas to learn more about the history, the inspirations, how it works, why it’s safe to run in production, how to get performance insights, and more!

https://podcast.thinkingelixir.com/142

Deleting LiveView Stream Elements by `dom_id`

We can delete LiveView stream elements with stream_delete/3 (already awesome!)

But we need the full record in memory. 😔

What if we only have the dom ID? 🤔

LiveView ships with a stream_delete_by_dom_id/3 function that lets us use the dom_id! 🥳

👀 short video exploring that! https://youtu.be/tg377m24Jls

ExRoseTree - A Rose Tree and Zipper in Elixir with a slew of navigation primitives.

Posted an announcement on elixir forum about a new lib I’ve released: ExRoseTree - a Rose Tree and Zipper in Elixir with a slew of navigation primitives.

Hopefully it can prove useful to some of you, and if nothing else it may be enjoyable to dig through if you just enjoy data structures. While I’ve deemed it good enough for its first release, there is certainly room for improvement and new features, so don’t hesitate to post issues in the issue tracker, propose feature requests, or contribute to further development.

Thanks, and happy zipping!

Post: https://elixirforum.com/t/exrosetree-a-rose-tree-and-zipper-in-elixir-with-a-slew-of-navigation-primitives/54520

Source: https://github.com/metacode-io/ex-rose-tree

Docs: https://hexdocs.pm/ex_rose_tree/ExRoseTree.html

Using npm to manage JS dependencies in Phoenix

Blogged on how to use npm to manage all JS dependencies in Phoenix - https://latinum.xyz/posts/phoenix-1.7-with-npm/

Elixir/Phoenix Security Live Coding: Deserialization and Preventing Remote Code Execution

Tuesday, March 21, 4pm EST join the founder of Paraxial.io, Michael Lubas, for a live webinar on secure coding in Elixir.

https://paraxial.io/live_rce

Finitomata ❤ Mox

Blogged on how to use Mox to test highly concurrent applications (on the Finitomata example.)

https://rocket-science.ru/hacking/2023/03/06/finitomata-mox-testing

Synchronization points. The proper way to test FSM in details: how to control data flow (opinionated approach.)

Using macros for consistent authorization

We recently needed to add authorization to a lot of our context modules. We’ve written a blog post about how we achieved this using macros:

https://nobilisdata.com/blog/using_macros_for_authorization/

Animating LiveView Deletions with JS.hide/2 & JS.push/2

Someone asked me how to animate deleting elements in LiveView. The trick is to use LiveView.JS:

  • JS.hide/2 with animate option to hide and animate, and
  • JS.push/2 to send the event to the server
  • ✨ beautiful deletions ✨

👀 https://youtu.be/rMZ6ypeDzjs

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!

Read here why it’s useful | Check out the source code

LiveView Streams

In episode 159 we’ll explore Phoenix LiveView streams.

https://elixircasts.io/phoenix-liveview-streams

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

https://youtu.be/FYCoAVpWp-U

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!

https://podcast.thinkingelixir.com/141

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.

https://paraxial.io/blog/holden-interview

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

Previous page Next page