Introducing Kanta - the ultimate open-source solution to translations in Elixir & Phoenix web apps
Handling translations in web applications can be a challenging and time-consuming task. The process entails managing various files, tracking modifications, and ensuring that translations remain current as the project progresses. These complexities can slow down development and introduce errors. That’s why Curiosum decided to create an open source solution called Kanta.
The Elixir Book Club is starting Genetic Algorithms in Elixir on September 17th.
📘👨💻💜 The Elixir Book Club has chosen our next book!
Genetic Algorithms in Elixir
We meet every two weeks on Sunday mornings via our Discord. The first meeting for the new book is on September 17th. Join us! #MyElixirStatus
You can stop using `form_for`
The standard way to render a <form>
in Phoenix used to be the form_for/4
helper, but recent versions of Phoenix added a new function component called <.form>
, AKA Phoenix.Component.form/1
.
I wasn’t sure when to use form_for/4
instead of <.form>
, but it turns out that the answer is “never”. I wrote up my full findings here:
https://phoenixonrails.com/blog/you-can-stop-using-form-for-in-phoenix
Unpacking Elixir: Syntax
Time to cover Elixir syntax: https://underjord.io/unpacking-elixir-syntax.html
Liveview File Uploads to S3
How to add support for LiveView’s interactive file uploads, directly uploading to Amazon S3.
Star-Crossed LiveView Processes
Elixir has many powerful runtime features: processes, monitors, links, supervisors, and more. Sometimes, the hardest part is knowing which building blocks are the best ones for what we want to do. In this post I explore linking processes, trapping exits and running an async Task from a LiveView to solve a different kind of problem.
There’s been a lot written about running an async Task from a LiveView, but I wanted to build a ChatGPT-style UI where the data flows in, not just the final computed result.
In fact, I only care about the series of messages sent as side effects from the running Task. This difference changes how we approach the problem. In the post we see ho process linking is like Romeo & Juliette. When Juliette dies, it causes Romeo to die as well, the two are linked. This is the same for linked processes. But if we trap exits, our LiveView will be “notified” of a Task processes’ death without being killed. Turns out it’s both really simple and really powerful! I ❤️ the BEAM!
https://fly.io/phoenix-files/star-cross-live-view-processes/
Writing a Custom Credo Check in Elixir
Let’s run through the process of creating a Credo check in Elixir: https://blog.appsignal.com/2023/08/29/writing-a-custom-credo-check-in-elixir.html
Thinking Elixir 166: Filtering, ordering and pagination via Flop
Episode 166 of Thinking Elixir. Most of us have created our own filtering, sorting and pagination code before in one project after the other. Mathias Polligkeit got tired of doing that too and created the flop library to wrap it all into a portable and reusable solution. We talk with Mathias to learn what it can do and are pleased to learn it’s surpassed our own solutions. He also created a flop_phoenix package with heex components to help build filter forms and tables. An fun look into an interesting library!
GigCityElixir Talks - Frank Hunleth
GigCityElixir 2023 talks - Frank Hunleth “Nerves Project Update” https://youtu.be/H6dSdiyacPs
Unpacking Elixir - Concurrency
Rather than writing yet another post trying to widely summarize what I think is beneficial about the language I want to try and go a bit deeper on one particular aspect I like. This time, concurrency.
Vio.com is hiring Senior Elixir Engineer
Vio.com is hiring a Senior Elixir Engineer to work at Amsterdam (relocation available) or Remote.
Experience with Elixir is a plus, but not a hard requirement as long as you are excited to learn it and you have experience with at least two programming languages such as Erlang, Ruby, Go, Rust, Python, Java or Scala.
Come to join my team at Vio.com and have fun writing Elixir applications to build our booking engine.
Find out more in here: https://grnh.se/1cdc4ab2teu
PhoenixStorybook
Episode 169 is in the books. In it, we’ll use PhoenixStorybook to create a storybook-like UI for our Phoenix Components.
Oban Web v2.10-RC Released
The first Oban Web v2.10 release candidate is out! Oban Web v2.10 brings a few long awaited features like realtime charts, auto-complete powered filtering, keyboard shortcuts, and massive performance improvements for high throughput systems.
Thinking Elixir News 165
Episode 164 of Thinking Elixir. In the news, we cover a new Livebook Desktop feature tease, a new daily bite-sized Elixir newsletter, Supabase’s new Supavisor architecture, and Livebook joins the online Spawnfest competition as a sponsor. We also share a PSA about Alpine Docker image troubles with OTP 26 and an Ecto schema introspection tip. Elixir’s errors get more helpful when modules aren’t found, then a new Hex search tool was created and explained, and much more!
Implicit try in Elixir
We wrote about one of numerous features and syntactic constructs that contribute to the language’s elegance and expressiveness. One such hidden gem is the concept of “implicit try”.
Elixir Streams |> Phoenix forms backed by embedded schemas
If you have complex forms that you want to decouple from the database, we can use Ecto’s embedded schemas to back a form.
That gives us all the power of Ecto changesets without having to tie our form to our database schema!
Check it out! 👉 https://www.elixirstreams.com/tips/phoenix-forms-backed-by-embedded-schemas
Blog Post: Simple AI "Agent" using ChatGPT's Functions API
I wanted to see what it would take to expose custom functionality to ChatGPT in my own app, so I built a little sample in Elixir to let the chatbot view and make changes to a user’s (fake) calendar.
https://revelry.co/insights/artificial-intelligence/creating-an-agent-using-openais-functions-api/