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

Six Year Club
Five Year Club
Four Year Club
Writing Debut
Three Year Club
Two Year Club
One Year Club
XSS vs CSRF: Two Browser Attacks With Two Different Fixes

XSS vs CSRF: Two Browser Attacks With Two Different Fixes

Comments
6 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
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 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
queueMicrotask Explained: The Smallest Async Queue in JavaScript

queueMicrotask Explained: The Smallest Async Queue in JavaScript

Comments
1 min read
CDN Explained: What It Is, How It Works, and How to Use It in Next.js

CDN Explained: What It Is, How It Works, and How to Use It in Next.js

Comments
2 min read
React memo vs useMemo vs useCallback — When to Use Which

React memo vs useMemo vs useCallback — When to Use Which

Comments
2 min read
CORS Explained Simply — Why Your Fetch Works in Postman but Fails in the Browser

CORS Explained Simply — Why Your Fetch Works in Postman but Fails in the Browser

Comments
5 min read
?? vs || — The Default-Value Trap That Breaks Real Apps

?? vs || — The Default-Value Trap That Breaks Real Apps

Comments
3 min read
React useEffect Dependencies — The Bug That Keeps Coming Back

React useEffect Dependencies — The Bug That Keeps Coming Back

Comments
4 min read
Debounce vs Throttle — One Sentence to Remember Forever

Debounce vs Throttle — One Sentence to Remember Forever

Comments
3 min read
The Leaderboard That Ranked 9 Points Above 100

The Leaderboard That Ranked 9 Points Above 100

Comments
4 min read
You Selected Rows 3, 8, 12, 15 and 20. JavaScript Checked 3, 1 and 8.

You Selected Rows 3, 8, 12, 15 and 20. JavaScript Checked 3, 1 and 8.

Comments
4 min read
One Line in My Root Layout Turned 158 Static Pages Into 0

One Line in My Root Layout Turned 158 Static Pages Into 0

Comments
5 min read
JavaScript ASI: Why return on Its Own Line Gives undefined

JavaScript ASI: Why return on Its Own Line Gives undefined

Comments
4 min read
The $4.35 Item That Was Charged $4.34

The $4.35 Item That Was Charged $4.34

Comments
4 min read
The Leaderboard Arrived Sorted. JavaScript Re-sorted It by User ID.

The Leaderboard Arrived Sorted. JavaScript Re-sorted It by User ID.

Comments
4 min read
Scrolling My Blog Index Prefetched All 51 Posts. One Config Line Cut It to 90 kB.

Scrolling My Blog Index Prefetched All 51 Posts. One Config Line Cut It to 90 kB.

Comments
4 min read
The Server Action That Ran Twice, but Only on localhost

The Server Action That Ran Twice, but Only on localhost

Comments
4 min read
useTransition Explained: Make React Feel Instant

useTransition Explained: Make React Feel Instant

Comments
3 min read
JavaScript Generators & Iterators — Lazy Sequences Explained

JavaScript Generators & Iterators — Lazy Sequences Explained

Comments
3 min read
I Optimized a Button From O(n) to O(1). The Speed Didn't Matter.

I Optimized a Button From O(n) to O(1). The Speed Didn't Matter.

Comments
8 min read
Understanding HttpOnly Cookies: The Envelope JavaScript Can't Open

Understanding HttpOnly Cookies: The Envelope JavaScript Can't Open

3
Comments
4 min read
Why MUI Avoids Theme Flash on First Load (Dark/Light Mode)

Why MUI Avoids Theme Flash on First Load (Dark/Light Mode)

Comments
2 min read
Deep Copy vs Shallow Copy in JavaScript

Deep Copy vs Shallow Copy in JavaScript

Comments
2 min read
Why setState Doesn’t Cause Hydration Errors

Why setState Doesn’t Cause Hydration Errors

Comments
2 min read
loading...