LiveView's new Streams
Just tested out LiveView’s new streams. I gotta say, I like the ergonomics! 🙌
- Use phx-update=”stream”
-
Create stream with
stream/2
-
Add/update stream with
stream_insert/4
-
Delete from stream with
stream_delete/3
Thanks Phoenix team!
A test drive of Diana’s new hex package, Orion
I use it to check and ensure I’m getting about 30 frames a second on my LiveView game. https://youtu.be/ME-7iGSIw_M
How To Upgrade Elixir Phoenix Smoothly - 1.7 Edition
Phoenix Framework 1.7 was released this month and came with some cool new features and significant changes (that are optional). You can check out my video to find out what’s new, how to update your application, and a nice tool to make updating smoother. https://youtu.be/XAqGHmlp41M
Adding images to a Phoenix application
A basic look into how to load images and assets in a phoenix application. https://youtu.be/tl_sv6Qc9Jg
ReadReplica Issue #5 - Longest Palindromic Substring
An Elixir solution for LeetCode’s Longest Palindromic Substring problem with detailed explanation and time complexity analysis. https://readreplica.io/leetcode-longest-palindromic-substring-elixir/
Can’t Live `with` It, Can’t Live `with`out It
“I’d like to share some thoughts about Elixir’s with keyword. with is a wonderful tool, but in my experience it is a bit overused. To use it best, we must understand how it behaves in all cases.”
https://www.erlang-solutions.com/blog/cant-live-with-it-cant-live-without-it/
Elixir/Phoenix Security: Rate Limits for Authentication with Hammer
How to use the Hammer library to apply rate limiting to authentication routes in Phoenix.
Prying into dependencies
I love how easy it is to do code spelunking 🤿 in Elixir projects!
- Dive into your “deps/“ directory
-
Throw a
dbg()
(orIO.inspect
) in the dependency you want 🔍 -
Recompile with
mix deps.compile
- Celebrate! 🥳
Check out a short video of me doing that 👉 https://youtu.be/jgEhnv4-c6I
Thinking Elixir News 139
Episode 139 of Thinking Elixir. New Phoenix LiveView 0.18.12 release includes a new “streams” feature as well as other improvements. Andrea Leopardi released another Protohackers video, AppSignal adds Oban support, Orion library brings nifty distributed tracing UI, José does an interview with Exercism, Gleam gets added to Exercism, EMPEX NYC is back, and more!
ReadReplica Issue #4 - Median of 2 Sorted Arrays
An Elixir solution for LeetCode’s Median of Two Sorted Arrays problem with detailed explanation and time complexity analysis. https://readreplica.io/leetcode-median-sorted-arrays-elixir-solution/
Safe Ecto Migrations by Fly.io
I ran across this repo from the Fly.io team about safe ecto migrations which then lead me to the article on the Fly.io blog
Updating nested structs with put_in/2
Updating nested data in Elixir can be tough, since all data is immutable.
There’s a nice helper put_in/3
that works with maps. But unless structs implement the Access behaviour, we cannot use it with structs.
Turns out, there’s a put_in/2
macro that works with structs out of the box!
Webinar, Elixir/Phoenix Security: Preventing SQL Injection in Ecto
Recording of the Paraxial.io webinar, “Elixir/Phoenix Security: Preventing SQL Injection in Ecto”.
Livebook inside Hugging Face Spaces
Hugging Face is a platform for building, sharing, and collaborating on machine learning applications.
This blog post explains how to run Livebook inside Hugging Face Spaces.
Why Does Paraxial.io Focus on Elixir Security?
Paraxial.io is an application security platform created for Elixir. This post details the motivation for focusing the company on Elixir.
https://paraxial.io/blog/elixir-focus
Building multiplayer gaming & gamedev platform with Elixir, Phoenix LiveView and Rust
Heyplay stack — Elixir, Rust, Lua, Fly.io and others — plays a key role in enabling the development of something as complex as multiplayer gaming and game creation platform as an indie effort. Let’s see how it all comes together to turn my dream project into reality.
Read more on Heyplay blog
LiveViewTest's awesome form/3 helper
There are two ways to write LiveView form tests:
- Using view |> render_submit/3
- Using view |> form/3 |> render_submit/2
🔥Always use the form/3
helper🔥
It validates the form data against the HTML to ensure the elements exists! 🎉
Customize outputs with Inspect protocol
The latest changes to the Inspect protocol can help you change the way data is presented. With the new optional option, you can only indicate information when the data has changed.
See more on: https://bartoszgorka.com/customize-outputs-inspect-protocol
Custom Styling With LiveView Function Component Attributes
Ever defined function components with customizable CSS styles in LiveView? In this post I did it using the new function component attributes. https://fly.io/phoenix-files/customizable-classes-lv-component/