Supply chain attacks are a growing threat in the software development world, particularly with the rise of open-source package managers like NPM. These attacks exploit the trust developers place in third-party libraries and dependencies, leading to potentially devastating consequences. This post will break down the lifecycle of a software supply chain attack, explain how it works, and provide strategies to mitigate the risks. What is a Supply Chain Attack? A software supply chain attack occurs when a malicious actor infiltrates the software development process to inject malicious code into a legitimate application. With package managers like NPM, this often involves...
Ensuring a consistent look and feel across different browsers is a big challenge for web developers. One of the earliest and most persistent tools developed to tackle this issue is the CSS reset. This post explores what CSS resets are, why they were invented, and how their philosophy has evolved over the years. What is a CSS Reset and Why Was It Created? A CSS reset is a stylesheet that overrides the default, built-in styles of a web browser. They solve browser inconsistencies. In the early days of the web, browsers like Netscape Navigator and Internet Explorer had their own...
One of my favorite quotes about software development comes from Larry Wall, the creator of Perl: > We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris. > > —Larry Wall, Programming Perl 1st Edition As the book explains, Laziness is "the quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don't have to answer so many questions about it." I agree entirely. Productive laziness — the drive to build...
The way we've done content caching using CDNs is changing, and it's not always intuitive. As a developer, you might have relied on the idea that using a popular CDN for libraries like jQuery would speed up your site because users already had the file cached. As we'll see, this is no longer the case. This post explain the old and new strategies for working with CDNs, how browser caching has changed, and what you should do to optimize your site in 2025 and beyond. Original CDN Caching In the old days browser caching was simple. The browser used a...
When researching CSS features that mimic SASS features I came accross the if function. This function allows you to apply conditional logic directly in your CSS, similar to how you might use it in SASS. This post will cover Chromium's implementations of the if function, which is currently behind a flag, and how it can be used to create dynamic styles based on conditions, along with fallbacks for browsers that don't support it yet. At the time of this post, this feature is only available in Chromium-based browsers Chrome, Edge, and Opera behind the Experimental Web Platform features flag. The...
In 2023, Chris Coyier wrote SASS features in CSShttps://chriscoyier.net/2023/07/11/sass-features-in-css/ where he explores the SASS features that have been adopted in CSS. It's been a couple years so, in this post, I will explore how have the features in Chris's article evolved and what additional features, originally in SASS, have been added to CSS. We'll also look at some of the SASS features that are still not in CSS. Some background SASS is a CSS preprocessor that extends the capabilities of CSS with features like variables, nesting, mixins, and more. It has been widely adopted in the web development community for...
As a way to learn React and exercise Typescript, I started building a recipe database application using PostgreSQL as the database, Express as the API server, and Vite/React as the client. This post will cover notes, observtions, design decisions and challenges I've faced while building the application. Why these tools? Before we start with specifics, let's talk about the tools I've chosen for this project: PostgreSQLhttps://www.postgresql.org/ is powerful, open-source, and has great support for JSON data types, which is useful for storing recipe data. I chose to use Prismahttps://www.prisma.io/ as the Object Relational Mappinghttps://www.freecodecamp.org/news/what-is-an-orm-the-meaning-of-object-relational-mapping-database-tools/ ORM because it provides a type-safe...
Temporal is a new API designed to handle dates and times in Javascript. It is designed as a replacement for the existing Date API, without taking over the Date namespace. Unfortunately, it is not yet available in all browsers, so we need to dynamically load it when it is not natively available. This post will explore how to dynamically load the Temporal API in a web application. It will also cover a subtlety in feature detection and how to use the temporal API once it's loaded. The problem I like the Temporal API better than the existing Date one so...
Homebrew is a powerful package manager for macOS that simplifies the installation and management of software. Migrating your Homebrew setup to a new Mac can be an easy process if you follow the right steps. This post will cover the steps to migrate your Homebrew setup from an old Mac to a new one, including how to create a Brewfile, and how to use it to restore your setup on the new machine. Migrating Homebrew to a New Mac: A Seamless Transition You can seamlessly transfer your entire Homebrew environment — from command-line utilities like git and node to GUI...
Managing monorepos, a single repository with multiple packages each with its own package.json and dependencies, can be challenging. This is where NPM workspaces come in. This post will cover what are NPM workspaces, how to use them, how they compare with Yarn and PNPM workspaces and how they interact with monorepo tools like Lerna and Nx. What are workspaces? NPM workspaces are a feature built into the npm CLI that allows you to manage multiple distinct packages from within a single, top-level root package. It's the native solution for creating a monorepo. You define a workspace by adding a workspaces...