Systems | Development | Analytics | API | Testing

June 2022

LiveView Assigns: Three Common Pitfalls and Their Solutions

In the first part of this two-part series, we examined LiveView assigns in detail — demystifying assigns, looking at some key concepts, and debugging. Now, we'll turn our attention to three common mistakes that you might make with assigns and how to avoid them. Let's get started!

State Machines in Ruby: An Introduction

A state machine can hold all possible states of something and the allowed transitions between these states. For example, the state machine for a door would have only two states (open and closed) and only two transitions (opening and closing). On the other hand, complex state machines can have several different states with hundreds of transitions between them.

How to Handle Errors in React

Let's face it. Nobody wants to see a broken, empty page while surfing the web. It leaves you stranded and confused. You don't know what happened or what caused it, leaving you with a bad impression of the website. It is often better to communicate the error and let the user continue to use the app. The user will get less of a bad impression and can continue to use its features. In today's post, we'll go through different ways to handle errors in React applications.

A Guide to Phoenix LiveView Assigns

Phoenix LiveView lets you develop full-stack apps with client-side interactions while mostly avoiding cross-stack hassle. Assigns, managed by the LiveView socket, are a core tool for making that happen — allowing you to store, present, and update data effortlessly and efficiently. But as they do so much, assigns come with their own complexities and may backfire if misused.

Add Feature Flags in Ruby on Rails with Flipper

Picture this scenario: you are a Rails developer and have spent the last couple of days developing that awesome feature that everyone is waiting for. It's big and complex, but it went through rigorous testing, so you are confident everything works as it should. There are deadlines to meet, so you deploy. Immediately, all hell breaks loose. Your feature straight up breaks the entire app for some of your users. It's hard to say why. No bugs showed up during testing.

Build a Data Access Layer with PostgreSQL and Node.js

The Data Access Layer (DAL) is the most critical part of any application. This is where the code integrates with an external source of truth like a database. In this take, we'll show you how to build a DAL that talks to Postgres via Node. Then we'll go into best practices like Clean Architecture and what this means in practical terms. Ready? Let’s go! First, a quick note about the code: The code will have modern niceties like TypeScript, unit tests, and will tackle potential scalability issues.