Tech Posts

(21)

Contributing a New Feature to Open Source: @sindresorhus/is

This post is a recount of my recent experience contributing to is, a JavaScript open source type checking library. https://github.com/sindresorhus/is https://www.npmjs.com/package/@sindresorhus/is I’ll outline the process from beginning to end: the initial filing of the feature request, implementing the feature, collaborating on the pull request, and getting the feature released. Some of the open…

Testing immutable js with sinon custom matchers

Problems with unexpected assertion failures can arise while testing immutablejs with sinon. This post is a brief guide on how to create a custom matcher that will correctly calculate the equivalence between a mock/stub/spy call with an immutable parameter. The way I’ll be making the assertion is with calledWith from sinon-chai (a plugin for chai that helps with making should or expect assertions for sinon mocks). This github issue on sinonjs outlines the problem...

How to Squash All Commits Related to a Single Issue into a Single Commit

Previously, I wrote a guide on formatting commit messages. I’ve had the opportunity to work on a codebase that requires squashing commits into a single commit. This post is a reliable guide to squashing. What does “squashing” do? It allows you to take changes that are spread amongst multiple commits and consolidate them into one. Why should one consider squashing commits? A clean history makes…

Intro to JavaScript Frameworks Part 1: The Vanilla JavaScript Version of TodoMVC

The goal of this blog-series is to explain what frameworks do, why they’re used, and demonstrate with examples across many different frameworks. The series is aimed at those familiar with JavaScript syntax, accessing the DOM, functions, and classes (object-oriented programming). Further reading can be found at the bottom of this post. What is a JavaScript Framework? A framework is an imported…