Articles on JavaScript

Brian Griggs

Brian Griggs

It’s Never Been Better to Get Started with Cypress Web Tests

If your project could at all be described as a web application, your UX pipeline would likely benefit from adopting Cypress. Beating out Selenium on speed as well as breadth of testing tools, Cypress provides automated testing of your website’s critical features in a matter of minutes. A testing framework built on top of many

Eric Fung

Eric Fung

Migrating From Sprockets to Webpacker

Starting with Rails 6, Webpacker became the default asset compiler, replacing sprockets–better known as the asset pipeline. While the asset pipeline was a big step for its time in making it easy to package JS, CSS, and images, webpack has matured enough to do all of the above and more, due to modern JavaScript’s support

Will Ockelmann-Wagner

Will Ockelmann-Wagner

The Best of Both Worlds: HTML Apps & Svelte

At Carbon Five we try to be agile about our technology choices and pick the simplest tool for the job at hand. That means that even in 2019, the era of React and Redux and GraphQL and all the other fancy tools for client-side web applications, sometimes the best tool for our clients is a

Linden Melvin

Linden Melvin

Replacing Component Lifecycle Methods with React Hooks

When writing React components, we sometimes need access to lifecycle events to handle a variety of side effects: fetching data on mount, sanitizing props when the component updates, cleaning up before the component unmounts, etc.

Will Ockelmann-Wagner

Will Ockelmann-Wagner

Optimizing Performance in React 16.8

React Dev Tools comes with a profiler that can help pin down performance problems, and React 16.8 came with some features to make it easier to improve performance of functional components. But to use these tools effectively you need to know what the problem is and how to find the culprit.

Will Ockelmann-Wagner

Will Ockelmann-Wagner

Shallow Testing Hooks with Enzyme

Hooks significantly simplify your code, and you can use them within an existing React codebase that otherwise uses classes. And it’s easy to dive right into using hooks – until you try to test your fancy new components.

Will Ockelmann-Wagner

Will Ockelmann-Wagner

A Proposal: Elixir-Style Modules in JavaScript

Moving your code towards a more functional style can have a lot of benefits – it can be easier to reason about, easier to test, more declarative, and more. One thing that sometimes comes out worse in the move to FP, though, is organization. By comparison, Object Oriented Programming classes are a pretty useful unit

Lenny Turetsky

Lenny Turetsky

An AJAX Auto-Save Implementation

For a recent client engagement, we were tasked with implementing auto-save on a multi-field form: any time any of the field values changed, we’d save the form to the server. This is a common scenario where users are composing longer inputs, such as emails, word processing, and spreadsheets.

Will Ockelmann-Wagner

Will Ockelmann-Wagner

Easy pipeline debugging with curried console.log

These days I’ve been writing a lot more functional javascript, using tools like RxJS and Ramda. They allow for beautiful, declarative pipelines of functions, like:

Andrew Hao

Andrew Hao

Taking Elm for a Test Drive

Elm emerged on the scene in early 2012 as a strongly-typed, functional language that compiles down to Javascript. With its architecture and type system, it claims to provide bulletproof guardrails to help developers build systems that are highly reliable, with “no runtime exceptions in practice”. Elm prides itself on having a low barrier of entry