soyjeansoy

soyjeansoy

I wrote a blog post for creating a simple infinitescroll page using LiveView, Intersection Observer API and JS interop using phx-hook.

Here’s the working/canonical link for building simple infinite scroll using LiveView (and in less than 30 lines of JS).

0
Post #858
mattbaker

mattbaker

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 :smiley:

6
Post #859
realcorvus

realcorvus

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.

Detecting SQL Injection in Phoenix with Sobelow

1
Post #860
renatacuriosum

renatacuriosum

In this post, I will introduce you to the world of cybersecurity and tell you how Elixir programming language works in this environment.
Elixir vs Cybersecurity - is Elixir Language a Safe Technology?

2
Post #861
PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView

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.

https://www.peterullrich.com/prevent-overlapping-schedules-with-ecto-and-postgres

3
Post #862
ChristianAlexander

ChristianAlexander

New post describing how to implement a scrolling data table without running out of memory in Phoenix LiveView

0
Post #863
cmo

cmo

Is there not a limit to how many items the browser is happy to render? If you throw 1,000,000 items into your page, what happens?

0
Post #864
ChristianAlexander

ChristianAlexander

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.

0
Post #865
cmo

cmo

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

2
Post #866
PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView

How do you efficiently search through millions of names in Postgres and Ecto? This blog post dives into Postgres’ ILIKE and SIMILARITY operators and their important caveats.

Also included: The most in-depth explanation of how Postgres calculates the SIMILARITY score ever!

https://www.peterullrich.com/efficient-name-search-with-postgres-and-ecto

1
Post #867