DEV Community

Mohsen Fallahnejad profile picture

Mohsen Fallahnejad

Frontend developer. I chase weird JavaScript, React and Next.js bugs down to the real cause, then write the story. More at bitlyst.blog

4 Week Writing Streak
Six Year Club
Five Year Club
Four Year Club
Writing Debut
Three Year Club
Two Year Club
One Year Club
Does AI Actually Learn? Human vs Machine Learning

Does AI Actually Learn? Human vs Machine Learning

Comments
5 min read

Want to connect with Mohsen Fallahnejad?

Create an account to connect with Mohsen Fallahnejad. You can also sign in below to proceed if you already have an account.

Already have an account? Sign in
Why "Works on My Machine" Happens (And How to Fix It)

Why "Works on My Machine" Happens (And How to Fix It)

Comments
3 min read
Race Condition Explained: How to Find and Fix It

Race Condition Explained: How to Find and Fix It

Comments
4 min read
What Is MCP? The USB-C Port for AI

What Is MCP? The USB-C Port for AI

1
Comments
4 min read
Is AI Really Faster and Cheaper for Building Products?

Is AI Really Faster and Cheaper for Building Products?

Comments
3 min read
How to Build an MCP Server in 30 Lines of TypeScript

How to Build an MCP Server in 30 Lines of TypeScript

1
Comments
4 min read
AsyncLocalStorage: A Name Badge for Every Request

AsyncLocalStorage: A Name Badge for Every Request

Comments 2
4 min read
Next.js Memory Leak: The Timer That Kept Every Request

Next.js Memory Leak: The Timer That Kept Every Request

Comments 2
5 min read
Database Indexes: The Back Page of the Book

Database Indexes: The Back Page of the Book

Comments
4 min read
any vs unknown vs never in TypeScript, Simply

any vs unknown vs never in TypeScript, Simply

Comments
3 min read
Sessions vs JWT: Where Does Your Login Actually Live?

Sessions vs JWT: Where Does Your Login Actually Live?

Comments
4 min read
async vs defer: Why Script Order Breaks Your Page

async vs defer: Why Script Order Breaks Your Page

Comments
3 min read
Idempotency: Why a Retried Payment Can't Charge Twice

Idempotency: Why a Retried Payment Can't Charge Twice

1
Comments
4 min read
forEach and async/await: Why Your Loop Doesn't Wait

forEach and async/await: Why Your Loop Doesn't Wait

Comments
4 min read
What Runs First in a Next.js Page: Server Components, Render, Effects

What Runs First in a Next.js Page: Server Components, Render, Effects

Comments
5 min read
You Don't Need That useEffect: Derived State in React

You Don't Need That useEffect: Derived State in React

1
Comments 1
4 min read
Boolean(x) vs !!x, Number vs parseInt, and String() vs toString()

Boolean(x) vs !!x, Number vs parseInt, and String() vs toString()

Comments
6 min read
satisfies, as, as const, and is: How TypeScript Labels a Value

satisfies, as, as const, and is: How TypeScript Labels a Value

Comments
6 min read
How Garbage Collection Works: It Never Looks for Unused Memory

How Garbage Collection Works: It Never Looks for Unused Memory

1
Comments
5 min read
Hoisting and the TDZ: Why let Throws and var Is undefined

Hoisting and the TDZ: Why let Throws and var Is undefined

2
Comments
4 min read
Barrel Files (`index.ts`): Why One Import Can Slow Your Build

Barrel Files (`index.ts`): Why One Import Can Slow Your Build

1
Comments
4 min read
useEffect vs useLayoutEffect: Why the Tooltip Flashes, Then Jumps

useEffect vs useLayoutEffect: Why the Tooltip Flashes, Then Jumps

1
Comments
5 min read
XSS vs CSRF: Two Browser Attacks With Two Different Fixes

XSS vs CSRF: Two Browser Attacks With Two Different Fixes

Comments
6 min read
A Philosophy of Software Design Summary: Deep Modules Beat Small Ones

A Philosophy of Software Design Summary: Deep Modules Beat Small Ones

Comments
7 min read
How V8 Makes JavaScript Fast: Ignition, Sparkplug, Maglev and TurboFan

How V8 Makes JavaScript Fast: Ignition, Sparkplug, Maglev and TurboFan

Comments
6 min read
React Server Components vs 'use client': What Actually Ships to the Browser

React Server Components vs 'use client': What Actually Ships to the Browser

Comments
6 min read
Why React Needs key: The Bug That Moves Your Input to the Wrong Row

Why React Needs key: The Bug That Moves Your Input to the Wrong Row

Comments
5 min read
Packed vs Holey Arrays in V8: Why new Array(n) Makes Spread 4x Slower

Packed vs Holey Arrays in V8: Why new Array(n) Makes Spread 4x Slower

Comments
6 min read
Next.js use cache, cacheLife and cacheTag: How One View Counter Rebuilt Every Page

Next.js use cache, cacheLife and cacheTag: How One View Counter Rebuilt Every Page

Comments 2
6 min read
How 'this' Works in JavaScript: Decided by the Call, Not the Code

How 'this' Works in JavaScript: Decided by the Call, Not the Code

1
Comments
3 min read
What Is Turbopack? How Next.js's Rust Bundler Avoids Doing Work Twice

What Is Turbopack? How Next.js's Rust Bundler Avoids Doing Work Twice

Comments
4 min read
turbopackRustReactCompiler: Running the React Compiler in Rust Inside Next.js

turbopackRustReactCompiler: Running the React Compiler in Rust Inside Next.js

Comments
4 min read
Bun vs npm, Yarn, Vite and Webpack: Who Does What in a JavaScript Kitchen

Bun vs npm, Yarn, Vite and Webpack: Who Does What in a JavaScript Kitchen

Comments
5 min read
JavaScript Classes Are Functions in a Costume (and What this.constructor Points To)

JavaScript Classes Are Functions in a Costume (and What this.constructor Points To)

Comments
3 min read
How SSR Works in React and Next.js: Built on the Server, Wired Up in the Browser

How SSR Works in React and Next.js: Built on the Server, Wired Up in the Browser

1
Comments
5 min read
How Next.js Turns JSX and TypeScript Into Plain JavaScript

How Next.js Turns JSX and TypeScript Into Plain JavaScript

Comments
4 min read
"Your Code Is Sloppy" Isn't Feedback. A Link to Line 42 Is.

"Your Code Is Sloppy" Isn't Feedback. A Link to Line 42 Is.

Comments
6 min read
AI Is Your Junior Developer. Your Product Still Needs a Senior.

AI Is Your Junior Developer. Your Product Still Needs a Senior.

Comments
16 min read
Start Learning From the Docs. Then Find Your Own Way.

Start Learning From the Docs. Then Find Your Own Way.

Comments
8 min read
Sliced Strings in V8: How a 20-Character ID Keeps 1 MB Alive

Sliced Strings in V8: How a 20-Character ID Keeps 1 MB Alive

Comments
4 min read
Hidden Classes in V8: Why Object Shape Changes Speed

Hidden Classes in V8: Why Object Shape Changes Speed

Comments
5 min read
V8 Garbage Collection: Why Middle-Aged Objects Are the Expensive Ones

V8 Garbage Collection: Why Middle-Aged Objects Are the Expensive Ones

Comments
5 min read
Layout Thrashing: Why Reading offsetWidth in a Loop Freezes the Page

Layout Thrashing: Why Reading offsetWidth in a Loop Freezes the Page

Comments
4 min read
CPU Cache and JavaScript: Why Sorting an Array Can Make Loops 7x Slower

CPU Cache and JavaScript: Why Sorting an Array Can Make Loops 7x Slower

Comments
4 min read
What is Docker? The 2-minute mental model

What is Docker? The 2-minute mental model

1
Comments
1 min read
MVVM, Micro‑Frontends, and Domain‑Driven Frontend — A Practical Guide

MVVM, Micro‑Frontends, and Domain‑Driven Frontend — A Practical Guide

Comments
4 min read
Next.js App Router Caching — Cheat Sheet

Next.js App Router Caching — Cheat Sheet

Comments
2 min read
Microtask vs Macrotask in JavaScript — With Node.js vs Browser Notes

Microtask vs Macrotask in JavaScript — With Node.js vs Browser Notes

Comments
2 min read
JavaScript Promises Explained

JavaScript Promises Explained

Comments
2 min read
JavaScript Closures — A Simple Deep Dive

JavaScript Closures — A Simple Deep Dive

Comments
3 min read
Prefetching in Next.js Links Explained

Prefetching in Next.js Links Explained

Comments
2 min read
BroadcastChannel API in JavaScript

BroadcastChannel API in JavaScript

Comments
2 min read
React Context Explained: How It Works Under the Hood

React Context Explained: How It Works Under the Hood

Comments
3 min read
React Fiber Explained: How React’s Engine Actually Works

React Fiber Explained: How React’s Engine Actually Works

Comments
3 min read
useDeferredValue Explained: Keeping React UIs Responsive

useDeferredValue Explained: Keeping React UIs Responsive

1
Comments
1 min read
Are TypeScript Enums a Good Idea? (Bundle Size & Runtime)

Are TypeScript Enums a Good Idea? (Bundle Size & Runtime)

Comments
2 min read
Why async/await Doesn’t Make JavaScript Code Parallel

Why async/await Doesn’t Make JavaScript Code Parallel

Comments
2 min read
How Promise.all Works in a Single-Threaded JavaScript World

How Promise.all Works in a Single-Threaded JavaScript World

Comments
2 min read
Web Workers Explained for Frontend Developers

Web Workers Explained for Frontend Developers

Comments 2
2 min read
Promise.all vs race vs any vs allSettled: When Do You Stop Waiting?

Promise.all vs race vs any vs allSettled: When Do You Stop Waiting?

Comments
3 min read
loading...