Technical

314 articles ยท all categories

29 articles from 2021 ยท show all

December 2021

Small choices can wreck your codebase

wanna see the strangest looping construct I've found in production code?

November 2021

How defensive coding leads to bloat

Defensive coding is an important lesson and over time and engineers it leads to massive bloat, if you're not careful.

October 2021

How to configure Jest with TypeScript

Using plain Jest on a TypeScript codebase is kinda rough. No types in tests no thanks. Making Jest and TypeScript work together smoothly is something you do just rarely enough to forget the details. Hope this helps you and future me too โœŒ๏ธ

September 2021

Anything's a sorting problem if you squint hard enough

What's the most algorithmically fun code you've written recently? ๐Ÿค” Here's mine: A dataviz using a grid of triangles that fits into the client's logo.

July 2021

You don't need a big team to automate your work

The opposite of folks who follow every FAANG trend and over-engineer their companies to death, are the folks who *never* take advice from the big boys.

React 18 and the future of async data

Friend, I have glimpsed the future and it is amazing. React 18 is shipping with Suspense and startTransition for deferred component rendering, but not data loading. That's coming in a future 18.x version.

June 2021

A surprising feature of JavaScript optional chaining

This blew my mind, thought you'd like it too. You can do more with ?. than you thought.

Use Netlify's _redirects on Gatsby Cloud

Something always goes wrong when you change hosting providers. ๐Ÿ˜… For me it was redirects. A vital feature of any site migration.

A better React 18 startTransition demo

Demoing startTransition is hard. Modern computers are too fast ๐Ÿ˜… โ€“ Dan Abramov, a React core team member, helped me fix it up. Here's what I learned

Trying out React 18 Alpha

I read everything about React 18 Alpha, trawled through the work group, and ran some experiments. Here's what you'll wanna know.

A fun security bug with static rendering โ€“ CodeWithSwiz #31

The flash of unlocked content is great fun for any paywall

May 2021

Build privacy-focused blazing fast tweet embeds โ€“ CodeWithSwiz 30

Twitter embeds every tweet on your page as an iframe. Loads 1.2MB of JavaScript, makes 20+ HTTP requests and uses 100+ DOM nodes. ๐Ÿ’ฉ

Twitter embeds without JavaScript, pt1 โ€“ #CodeWithSwiz 29

Continuing our quest for better Lighthouse scores, more reader privacy, and less JavaScript we attacked the next biggest culprit ๐Ÿ‘‰ Twitter.

March 2021

Your serverless questions, answered

When talk comes to serverless, engineers have lots of questions. Here are some answers ๐Ÿ˜Š

Go full-stack in 5min with your first cloud function

How *do* you build a JavaScript function that runs in the cloud serverlessly? Here's how to get started with Vercel, Netlify, or AWS Lambda

Can you automate love?

What's the laziest thing you've ever built? For me it's a bot that sends cute pictures every day

If you can JavaScript, you can backend

When you think of a backend or server developer, who comes to mind? A wizard of arcane magics. The future belongs to full-stack frontend engineers.

That time serverless melted my credit card

Serverless is pretty cheap. But you *can* get it wrong.

Why serverless fits side-projects perfectly

How do you provision servers for no load most days THEN ALL THE LOAD THIS MINUTE? That's how side-projects work and it's hard

How a $12 AWS bill powers a $50k business

my point is that running server code on the web has become ridiculously cheap *and* easy

Variants โ€“ a quick tip for better React components

Reusable components like to grow boolean props for different situations and complexity soon blows up. Variant props are the perfect solution.

February 2021

Reverse engineer a GraphQL API to automate love notes โ€“ CodeWithSwiz 24

We used a man-in-the-middle attack to snoop an app's API traffic, replayed it in a GraphQL client, and successfully put it inside an AWS Lambda ๐Ÿค˜

A TypeScript trick for reusable hooks

Reusable hooks are all fun and games until TypeScript starts yelling at you about incompatible types.

React Bricks - visual blocks editor for NextJS #CodeWithSwiz 22

Tried a new visual editor for NextJS and CreateReactApp. Got a site up in 20min ๐Ÿค˜

The Magic Function principle

Write functions, mostly magic.

January 2021

[CodeWithSwiz 21] useAuth beta support for Firebase ๐ŸŽ‰

It works! useAuth has beta-level support for Firebase Auth ๐Ÿฅณ I did not expect that to take 3 sessions.

Tech interview best practice that fails in life

Tech interviews have a magic answer: The hashmap. And it's not always best on the job.

[CodeWithSwiz 20] Adding Firebase support to useAuth, pt2

Firebase continues to be ๐Ÿ’ฉ. No wonder people keep asking for support in useAuth. Almost there โœŒ๏ธ

[CodeWithSwiz 19] Firebase Auth support in useAuth, pt1

Support for Firebase Auth is one of the most requested features for useAuth and I figured what the heck, how hard can it be?