Elixir 1.14.0 added Kernel.dbg/2 to improve developer experience. I spent some time playing around with dbg as a replacement for IO.inspect. Here is a post with some examples of debugging a Phoenix app.
Learn how dbg can replace IO.inspect to enhance your debugging workflow.
Elixir is gaining in popularity and as a result many SaaS companies are now using Elixir and Phoenix as the basis of their technology stack. Here are some of the most interesting examples.
Many consider Elixir to be Rubyâs successor, so we decided to settle that. Together with CTO, MichaĆ Buszkiewicz and experienced Elixir & React Developer, Krzysztof Janiec, we decided to compare the two programming languages. Elixir vs Ruby in Depth Comparison
I wrote a blog post about how we have been using Ecto Queries for search / filter forms in web applications. It aims at the same problem as the ransack gem in the rails world, but with less magic.
Thanks for sharing! Great post and I love the accompanying Livebook as a means of extending the content without adding too much bloat to the post itself. Thatâs a great pattern for future content like that.
And another one. This time I explore using placeholders in Repo.insert_all/3. If you ever used insert_all/3 you probably sent waaaaaaaay more data than you had to. I explain how to never ever do this terrible mistake again, here:
I wrote a blog post on how we used the Observer to debug some weird memory spikes in our Elixir gateway app. It includes some pretty interesting learnings about how SSL certs are handled in processes. It was a fun debug adventure
Wrote a blog post on SQL injection in Phoenix. Covers how Ecto really discourages you from writing insecure code, what a vulnerable function looks like, and using Sobelow to detect this.
Todayâs blog post is about exclusion constraints in Postgres and how to prevent double-bookings of appointments with them. Itâs a nice dive into how to execute custom SQL code in your migrations and how timestamp ranges work in Posgres.
You can use this if you want to prevent any double-bookings of e.g. appointments, schedules, meetings, etc.
There is probably a practical limit to how many items you can shove into the DOM of a page, but the focus here was to minimize the per-connection server memory utilization.
In situations where millions of items should be rendered, it might be worth using a custom hook or some other client-side code to virtualize or GC the list.
I actually think fly.io uses phx-update="append" in their container logs page, which is much higher volume than anything Iâve ever shipped. As far as I can tell, they donât do anything to clean up the entries. Worst-case, the user can always refresh the page or a filtering UI can be added.
Donât mind me, I have a personal vendetta against âinfinite scrollâ. I have a somewhat lacklustre implementation of truly infinite scrolling so I always read posts about it with interest. Sadly, it always turns out to be finite scroll. It should be called âload a bit more until the browser collapses scrollâ or âgenerally sufficient amount of items scrollâ.
AFAIK if you want actual infinite scroll, you need virtual scrolling.
we knew that browsers start struggling with more than 20k log lines