Mastering JS Weekly

Pragmatic web development. No bloatware allowed!

Pragmatic web development. No bloatware allowed!

By subscribing, you agree with Revue’s Terms of Service and Privacy Policy and understand that Mastering JS Weekly will receive your email address.






A Practical Guide to istanbul/nyc Code Coverage Internals

Over the last couple of weeks we've been working on supporting code coverage with Temporal's TypeScript SDK. Supporting code coverage has been a challenging project, but it's also been rewarding.Code coverage tools like nyc mostly "just work." In most applica…


Who Needs Islands Architecture?

This architecture isn't an entirely new concept. Angular 1 devs remember the good old days of ngController, which was similar: write HTML, attach an `ng-controller` directive to bind part of the HTML to an Angular controller.ngController was largely forgotten…


Public Class Fields: A Better Way to Define Methods in JS?

Unfortunately, class methods still suffer from the same function binding issues as normal JavaScript functions. The value of `this` in the `area()` function is equal to the object that `area()` is attached to when you call `area()`. So, if you call `area()` w…


Mastering JS in 2022: Focus on Browser Tools

The other reason is we need to solve these problems in an adhoc one-off way, rather than an automated way. We're not searching for an HTML to Pug converter so we can make that part of a Webpack build. We're searching for a converter because we have some HTML …


Right-Sizing Automated Best Practices

Earlier this week, I was cleaning up some build failures on Temporal's TypeScript SDK samples. The build was failing because of a Prettier formatting issue in the .vscode folder. That hid a few other linter issues that were caused by adding a new rule after t…


Our Favorite JavaScript Reads from 2021

2021 truly was the best of times and the worst of times, the age of wisdom and the age of foolishness. On one hand, I became a dad, went full-time on my own business, and solidly hit my ambitious financial goals. On the other hand, there was a stroke and a ca…


On Writing About What You've Learned

Writing is a great way to learn. Not only do you get a handy guide you can refer back to when you need to brush up, the exercise of writing something down helps solidify your understanding. Like taking notes in class.


Testing Webhooks Without Clicking in UIs

Instead of repeatedly triggering the webhook, just trigger the webhook HTTP request once and put the HTTP request body in a Mocha test case.Here's an example from the Mongoose Pro backend. The function being tested is responsible for pulling a GitHub organiza…


Lessons In Preventing Mistakes from Our Stripe Webhook Outage

In addition to TDD, we usually recommend our clients have some sort of automated smoke testing in place that lets you spot check that your API isn't completely broken. A good smoke test is fast and simple. Nothing stateful: no logging in or updating data.In o…


Vue Templates - Same File or Separate File?

Recently, I've found myself switching to separating out Vue templates into separate HTML files, and bundling them using Webpack's html-loader.


In Defense of JavaScript's Date Class

Oddly enough, the < and > comparison operators work with JavaScript dates. And subtracting two dates returns the difference between the two dates in milliseconds. So comparing dates in JavaScript is actually very easy.


Building a Webhook to Label GitHub Issues

This week we've started adding features to our new project: the Mongoose Pro subscription. The first step is how we handle prioritizing sponsor issues. In order to identify which issues are from sponsors, we're adding a "Priority" label.


Vanilla JavaScript Component Libs Versus Vue Component Libs

Like most developers in my shoes, the first thing I did was type "vue toggle" into Google and pick the first npm package that showed up. vue-js-toggle-button. Looks promising, nice README, live examples look neat. Let's try it.


What Mongoose 6 Means for JavaScript

When Mongoose 5 was released in early 2018, async await had just been added to the JavaScript language spec. Node.js did not support async await yet. Mongoose had to rely on co and generators for testing, and Mongoose's docs still relied on callbacks and prom…


On Summer Vacation and Software Release Cycles

I wish somebody told me this before I started shipping products. I would always tell myself I'd take some time off once my project shipped, but then I'd always get sucked into follow-up work.Remember: releasing a project is the starting line, not the finish l…


Web Real Estate is the New Real Estate

Blogs monetized via ads/affiliate links sell for approximately 2.5x annual profits. This isn't great news if you're looking to build and sell blogs. But this is great news if you're looking to buy income.To put it into perspective, with cap rates in San Franc…


Rethinking State Management Libraries

When looking for a solution, we prefer to spend our time making sure we understand the problem rather than trying a bunch of different tools. If you look at the problem the right way, the solution is often obvious.In the case of state management, there are 3 …


Why We Love Azure Functions for Node.js

We're now offering the opportunity to sponsor one of our weekly newsletters! Learn more on our new GitHub Sponsors page.


Take the Direct Path

We often get questions about how to get started building a web app, and most of the time the questions have nothing to do with actually getting started building a web app. People who come from a business background tend to ask about how to hire and/or manage …


Introducing the Mastering JS Job Board

Mastering JS is rapidly becoming an indispensable part of my workflow. I can't even begin to list the number of times we had to refer back to our tutorials when building out our job board (Yes, we're using Vue and Mongoose). Now we're going to try our hand at…