• _hello
  • _about-me
  • _projects
  • _blog
  • _support
_contact-me
find me in:
@faeztgh
cd ../topics

JavaScript

// 11 articles on JavaScript by Faez Tgh — practical React, Next.js, TypeScript and web-performance write-ups.

01
performance

Instant Navigations with the Speculation Rules API

Jul 10, 2026· 5 min·971 words

A click that lands on an already-rendered page feels like magic. The Speculation Rules API is the standardized, low-effort way to get there — the browser prefetches or fully prerenders likely next pages so navigation is near-instant. Here's the mental model and the guardrails.

  • Performance
  • Web Standards
  • JavaScript
read-postopen
02
typescript

Discriminated Unions: TypeScript's Best Modelling Tool

Jul 4, 2026· 4 min·797 words

Most 'impossible states' bugs come from types that are too loose — an object with optional fields that shouldn't coexist. Discriminated unions make the illegal combinations unrepresentable, and give you exhaustive checking for free.

  • TypeScript
  • JavaScript
read-postopen
03
typescript

The TypeScript satisfies Operator, and When to Use It

Jun 20, 2026· 4 min·774 words

There's a tension in TypeScript between 'check that this matches a type' and 'keep the precise type of what I wrote.' A plain annotation forces you to choose the first and lose the second. The satisfies operator, added in 4.9, gives you both.

  • TypeScript
  • JavaScript
read-postopen
04
performance

Debounce vs Throttle: Taming Noisy Events in JavaScript

Jun 5, 2026· 5 min·902 words

Scroll, resize, input, mousemove — some events fire dozens of times a second. Debounce and throttle are the two techniques for turning that firehose into something your handlers can survive. They're often confused; they solve different problems.

  • JavaScript
  • React
  • Performance
read-postopen
05
performance

Core Web Vitals in 2026: LCP, INP, and CLS

May 19, 2026· 6 min·1,121 words

Google's Core Web Vitals are three numbers that quietly shape your search ranking and your users' patience. INP replaced FID in 2024 — here's what each metric measures, the thresholds that matter, and the fixes that actually help.

  • Performance
  • SEO
  • Web Vitals
read-postopen
06
performance

Nextjs Best Optimization Tools

Feb 13, 2024· 4 min·803 words

Performance doesn't happen by accident. Here are the tools every Next.js developer should know — from automated audits and bundle visualization to image compression and Core Web Vitals tracking.

  • Next.js
  • Performance
  • Tooling
read-postopen
07
typescript

TypeScript Decorators

Feb 6, 2024· 2 min·377 words

Decorators are one of TypeScript's most powerful features. Understand what they are, how they attach to classes and members, and how to write your own from scratch.

  • TypeScript
  • Decorators
  • Metaprogramming
read-postopen
08
typescript

Understanding Namespaces in TypeScript: A Deep Dive

Jan 9, 2024· 2 min·421 words

TypeScript namespaces bundle related code into logical containers and prevent naming collisions — but with ES6 modules now mainstream, should you still reach for them?

  • TypeScript
  • Namespaces
  • Code Organization
read-postopen
09
typescript

TypeScript: Mastering Overloading and Generics

Nov 21, 2023· 2 min·407 words

Function overloading and generics bring flexibility, reusability, and safety to TypeScript. Learn how each works and when to reach for them.

  • TypeScript
  • Generics
  • Function Overloading
read-postopen
10
typescript

Leveraging TypeScript's Advanced Types: Module Types and Indexed Access Types

Nov 21, 2023· 2 min·374 words

Derive types directly from your JavaScript modules using typeof import and indexed access types — fine-grained, module-driven type control in TypeScript.

  • TypeScript
  • Advanced Types
  • Type System
read-postopen
11
typescript

TypeScript Advanced Concepts

Aug 7, 2023· 1 min·216 words

Write more dynamic and robust TypeScript by mastering six advanced concepts: generics, union and intersection types, type guards, nullish coalescing, and discriminated unions.

  • TypeScript
  • Generics
  • Union Types
read-postopen

# other-topics

  • TypeScript20
  • React8
  • AI6
  • Next.js6
  • Performance6
  • Generics4
  • SEO3
  • Type Safety3
  • Utility Types3
  • Architecture2
  • LLM2
  • Tooling2
  • Type System2
  • Union Types2
  • Web Standards2
  • Advanced Types1
  • Autocomplete1
  • Backend1
  • Chrome Extension1
  • Code Organization1
  • Conditional Types1
  • CSS1
  • Decorators1
  • Developer Experience1
  • Frontend1
  • Function Overloading1
  • Hooks1
  • Infer1
  • MCP1
  • Metaprogramming1
  • Namespaces1
  • Omit1
  • Pick1
  • RAG1
  • Responsive Design1
  • Structured Data1
  • Template Literal Types1
  • Type Guards1
  • Type Inference1
  • URL Parameters1
  • useEffect1
  • useLayoutEffect1
  • Web Vitals1
  • YouTube1