Digests » 275


Find A Job Through Vettery

Get discovered by one of the thousands of hiring managers using Vettery to grow their companies’ tech teams with Elixir developers (like you). Here’s how it works: once you create a profile, hiring managers can extend interview requests based on desired salary, top skills, and career preferences. Sign up today - it’s completely free for job-seekers!

this week's favorite

Things Elixir's Phoenix Framework Does Right

I dabbled in Phoenix for a while now, but never really got my hands dirty with it right up until now. Apart from the whole framework being surprisingly well thought through, there are a few things that strike me as being done exceptionally well in Phoenix, compared to the rest of modern web frameworks.

Hassle free Testing Elixir modules in iEx shell

While working on Elixir project, we often test our functions or modules code in iex shell. Whatever change we make in our code, we fire iex -S mix command and all of our project modules are accessible in shell. Suppose, we have a module say Calculator which is nested under project mathematics directory . As per Elixir naming convention we are going to name that module as Mathematics.Calculator. We also implemented some function say square in this module.

Page-Specific JavaScript with LiveView and Webpack

I was recently working on a Phoenix web application involving LiveView. These days, the default front-end tooling experience involves using webpack to compile your JavaScript modules. In this post, I’ll explore how to use webpack when working with LiveView to conditionally load JavaScript assets for specific pages and, in doing so, help keep the size of app.js down and performance up.

A Brief Guide to OTP in Elixir

One of the main advantages of Elixir is that it is awesome for server-side systems. Forget using a million different technologies for things like data persistence, background jobs, and service crash recovery, OTP can supply you with everything.

Problems with GenServer Callback Types

At work, we are currently implementing a GraphQL API in Elixir which fronts and orchestrates several other APIs. Several of the APIs we interact with use OAuth token flows for authentication. We use the OTP GenServer1 behaviour to implement a cache for these tokens. GenServer has worked very well for this use case, but it has proven particularly useful for the more complicated OAuth refresh token flow, which has two separate expiration timelines. Clients invoke a GenServer.call/3 to request a token, and internally the cache uses Process.send_after/4 to implement the expiration timelines.