Is-Promise vs the Internet
Forbes Lindesay wrote a very useful npm package called is-promise. Developers use this package to check whether a particular object is a promise. The function returns a Boolean indicating the status. This is one of many JavaScript packages best describe as syntactical sugar. After all, it’s just an if statement with a few chained Boolean tests.
It turns out millions of projects use the is-promise library in their own code. Not only that, but over 700 other libraries use is-promise as well. To give you some context, Create React App, the Angular.js framework, and Amazon’s AWS Serverless CLI were part of the affected group. This very wide usage sets up the stage where a small problem in a tiny library has widespread effects.
Forbes is a stand-up guy, providing lots of free software to the JavaScript community. He also takes his responsibilities serious, even if he never intended for is-promise to be such a widespread dependency.
An unintended mishap caused a lot of problems for lots of JavaScript projects and frameworks. Forbes wrote up a post-mortem about the incident demonstrating his high-character and his commitment to excellence. Bravo Forbes! Keep doing what you do!
11 ways to create JavaScript modules?!
Did you know there are 11 ways to create modules in JavaScript? If you code JavaScript long enough, you’ll eventually run into them all. Dixan Yan on Microsoft ASP.net wrote them all up complete with example code into a single, easily referenceable blog post. Now you’ll be able to understand just what that weird code is doing.
Demystifying Building Native Modules for React Native
React Native modules bring together the shared code for both iOS and Android, as well as the platform specific code for each mobile operating system. Building out your code into modules makes it publishable and you can share this if you like with the React Native ecosystem.
Kamile Matulenaite explains how React Native modules are organized and assembled. She also talks about how to separate out your code into the right spots so that the module will follow the standardized format.
Tanner Linsley Custom Hooks Preso – JSConf Hawaii
Tanner Linsley was in Hawaii this February. How do we know? We have video evidence! Hawaii is a great place to be any time, but considering the travel restrictions in place, we all consider him a pretty lucky guy to have made it over to paradise before the lockdown.
All is not lost however. We, the internet at large, get the consolation prize of watching Tanner explain custom React hooks to us. This was an enjoyable presentation that could only have been made more enjoyable were I to be actually in the audience. Or in Hawaii right now.
There are Laws of User Experience?
Most React developers think they are pretty good at user experience. However, good is in the eye of the beholder as they say. Building a quality user experience can be more art than science most times. While there are endless videos, courses, and articles on how to program in JavaScript or React, there aren’t nearly as many useful resources for user experience.
Fortunately, Jon Yablonski finally wrote down what we all should know so we no longer have to be led only by intuition. Each page covers a specific law of user experience. Also, as a bonus, each page has a downloadable poster of that law. Now, when you find one you really like, or your coworkers keep breaking, print, post, and smile. Thanks Jon.
Massive Scale Monorepos and Webpack
Here at Digital Primates, we think a lot about Enterprise JavaScript and Enterprise React. Building Enterprise applications means there are complexities now and that will emerge in the future that require the right strategy.
Often times, the right advice for a small application with just a few screens, or being worked on by just a few developers, breaks down when the scale increases by an order of magnitude.
We’ve worked on some of the largest, most complex React apps in active use. As such, we help clients evolve their strategies to fit their use cases, not just what someone read on a blog.
We were happy to read Etsy had been struggling with some repo issues causes by a massive monorepo. Really large code bases strain build time and compute resources. Etsy has 12k different JavaScript files or modules. They recently switched to webpack for builds and have open sourced a helper library for large codebases. “Kevin” manages multiple instances of Webpack for you and keeps the resource usage manageable. If you have a large monorepo and wish your build time was faster, Kevin might be your answer.