RSSAmplifier

Blog

Pony Foo

Latest articles published on Pony Foo

ponyfoo.comRSS feed ↗10 posts

Latest posts

Bootstrapping a UI component library

Building — and adopting — a component library in the context of a vibrant business is no easy feat. Here are a few things we’ve learned. At a small startup, the timing is never quite right to start a component library. Extremely quick iteration is not usually associated with putting together a standardized set of components and conventions to use across your app, as your…

React Data Survival Kit

Handling data in React can be treacherous if you don’t know your way around. Learn some common patterns for fetching, storing, and retrieving data in this guide to help you avoid messy code traps. React’s flexibility means you can handle data in a lot of different ways. This guide will teach you patterns for fetching, storing, and retrieving data in React without the stress of…

Discovering patterns with React hooks

One of the things I enjoy the most about coding is discovering patterns. Being aware and mindful of the patterns emerging in your codebase can make it easier to keep that codebase consistent, readable and easy to navigate. Most patterns will remain unspoken, and some, that prove notably elegant, are named and promoted as best practices. Others might even be candidates for a basis of a new…

Disguise Driven Testing: Jest Mocks In Depth — Part 2

Mocks are a great way of preventing AJAX calls in tests, but they can also help you isolate side effects and impurities that can create complicated tests. As you learned in Part 1 , mocks are a great way to handle external data or any data that is likely to change. Mocking external data will likely be your most common use case and for a good reason. You want your tests to stick as closely to your…

Conflict Resolution and Code Reviews

Have you ever tried to do a code review on a PR that merges a large release branch or feature branch back into mainline, fixing merge conflicts? It’s not pretty. The diffs are often and easily very big, — 50k+ LOC big — have hundreds of commits, and the actual changes made by the engineer resolving the merge conflicts are virtually impossible to spot. This article covers one…

Disguise-Driven Testing: Jest Mocks in Depth

Testing can be simple. In fact, it is simple. Well, it is simple until impurities slip in. Code that would be easy to test becomes a nightmare as soon as you get impure data (like date checks) or complex external dependencies (such as DOM manipulations or large 3rd party libraries). The part that tends to frustrate developers most is when they have code that’s easy to read, easy to write,…

The Action Pattern: Clean, Obvious, Testable Code

Let’s convert a mock API endpoint for signing up new users in a mobile app into using the action pattern. When I first started writing software on the web, my code was a mishmash. Every project was loaded with unnecessarily long files and code left commented, thrown to the side of the road like an abandoned vehicle. The theme of the day was: unpredictability. Under ideal…

React State: Choose Wisely

Proper state handling in React will make your components simple and maintainable. Poor choices will give you lots of headaches in the long-term. There are plenty of options for managing state in a React app. But there’s very little guidance about which one you should use in any situation. Let’s fix that. The solution you pick to manage state should fit they way you want to use the…

GraphQL in Depth: What, Why, and How

GraphQL is all the rage, but what exactly is it? In this in-depth walkthrough, we take a look at what GraphQL is, how to use it, and why you should use it. Learn why GraphQL is all the rage! We’ll walk through the implementation of a schema for a popcorn company’s API, learning about types, queries, and mutations as we go. I love popcorn. As I’m writing this, I’m…

JavaScript Performance Pitfalls in V8

In recent years, JavaScript engines have improved on all fronts. The performance of JavaScript has reached a level where it can easily compete with programming languages that have traditionally been considered more appropriate for high-performance computing. This is not only true for V8, the JavaScript engine inside of Chrome and Node.js, but for all major JavaScript engines, including ChakraCore,…