• _hello
  • _about-me
  • _projects
  • _blog
  • _support
_contact-me
find me in:
@faeztgh

_blog

// 29 write-ups on React, Next.js, performance & web engineering.

// topics:TypeScriptJavaScriptReactAINext.jsPerformanceGenericsSEOType SafetyUtility TypesArchitectureLLMToolingType SystemUnion TypesWeb StandardsAdvanced TypesAutocompleteBackendChrome ExtensionCode OrganizationConditional TypesCSSDecoratorsDeveloper ExperienceFrontendFunction OverloadingHooksInferMCPMetaprogrammingNamespacesOmitPickRAGResponsive DesignStructured DataTemplate Literal TypesType GuardsType InferenceURL ParametersuseEffectuseLayoutEffectWeb VitalsYouTubeall topics
01
seo featured

Generative Engine Optimization (GEO): SEO for AI Search

Jul 19, 2026· 6 min·1,153 words

Search stopped being ten blue links. Google's AI Overviews, ChatGPT, and Perplexity now synthesize answers and cite a handful of sources. GEO is the practice of becoming one of those sources — and it rewards the same fundamentals good SEO always did, plus a few new ones.

  • SEO
  • AI
  • Structured Data
read-postopen
02
typescript featured

Streaming AI Chat in Next.js with the AI SDK

Jun 14, 2026· 5 min·1,016 words

Bolting an LLM onto a Next.js app is easy to demo and easy to get wrong. Here's the shape of a streaming chat feature that survives contact with real users — plus the rate-limiting, error, and cost details the tutorials skip.

  • Next.js
  • AI
  • React
read-postopen
03
performance

What's New in Next.js 16

Jul 15, 2026· 5 min·957 words

Next.js 16 is less about flashy new APIs and more about the framework growing up: a faster default bundler, a clearer caching story, and some deliberate renames that make the mental model honest. Here's what actually matters when you upgrade.

  • Next.js
  • React
  • Performance
read-postopen
04
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
05
typescript

Getting Structured Output From LLMs Without the Guesswork

Jul 7, 2026· 5 min·965 words

Asking a model to 'reply in JSON' and hoping is how you end up parsing prose at 2am. Modern models expose schema-constrained output and tool calling that guarantee the shape — the trick is choosing the right one and validating anyway.

  • AI
  • LLM
  • TypeScript
read-postopen
06
styling

CSS Container Queries: Components That Own Their Responsiveness

Jul 4, 2026· 5 min·1,035 words

Media queries ask about the viewport. But a card doesn't care how wide the screen is — it cares how much room it was given. Container queries finally let components answer that question themselves.

  • CSS
  • Frontend
  • Responsive Design
read-postopen
07
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
08
general

A Practical Primer on Retrieval-Augmented Generation (RAG)

Jul 2, 2026· 6 min·1,201 words

An LLM only knows what it was trained on and what you paste into the prompt. RAG is how you give it your own knowledge — your docs, your data — without retraining anything. Here's the pipeline, end to end.

  • AI
  • RAG
  • LLM
read-postopen
09
architecture

Server vs Client Components: A Practical Mental Model

Jul 1, 2026· 4 min·848 words

The App Router makes every component a Server Component by default, and 'use client' opts into the browser. Getting the boundary right is the single biggest lever you have over bundle size and interactivity — here's how to reason about it.

  • React
  • Next.js
  • Architecture
read-postopen
10
typescript

Model Context Protocol (MCP), Explained for Web Developers

Jun 28, 2026· 6 min·1,186 words

Every AI tool used to invent its own way of plugging into your data. MCP is the attempt to standardize that connection — one protocol, many clients, reusable servers. Here's the mental model, minus the hype.

  • AI
  • MCP
  • TypeScript
read-postopen
11
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
12
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
13
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
14
typescript

YouTube Playback Controller: A Powerful Chrome Extension for Video Speed Control

Aug 20, 2025· 5 min·1,046 words

YouTube's built-in speed controls barely scratch the surface. This open-source Chrome extension brings precise slider control, per-channel automation rules, multi-profile presets, and even reverse playback to your browser toolbar.

  • Chrome Extension
  • YouTube
  • React
read-postopen
15
react

useEffect vs useLayoutEffect

Feb 20, 2024· 1 min·291 words

Both hooks look almost identical, but their timing is worlds apart. Understanding when each one fires — and why that matters for visual updates and SSR — will save you from subtle bugs.

  • React
  • Hooks
  • useEffect
read-postopen
16
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
17
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
18
typescript

Dynamic Controlled Values

Jan 30, 2024· 2 min·321 words

TypeScript generics and index signatures let you build objects that accept any property key while keeping strict type checks — here's how to use them to write truly flexible, safe code.

  • TypeScript
  • React
  • Next.js
read-postopen
19
performance

Nextjs Code Optimization

Jan 23, 2024· 1 min·212 words

From dynamic imports and image lazy-loading to short-circuit rendering and async loops — six concrete techniques to squeeze more performance out of your Next.js app.

  • Next.js
  • Performance
  • TypeScript
read-postopen
20
typescript

Deep Dive into Const Assertions and Utility Types

Jan 16, 2024· 2 min·427 words

TypeScript's const assertions lock object shapes at compile time, and utility types like typeof and keyof let you derive precise types from real data — no duplication, no drift.

  • TypeScript
  • Type Safety
  • Utility Types
read-postopen
21
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
22
typescript

An In-Depth Guide to Key Removal in TypeScript

Dec 26, 2023· 2 min·344 words

A practical walkthrough of makeKeyRemover — a generic TypeScript function that strips one or more keys from an object while preserving full type safety and immutability.

  • TypeScript
  • Utility Types
  • Type Safety
read-postopen
23
typescript

Decoding URL Parameters with TypeScript: An In-Depth Guide

Dec 19, 2023· 2 min·352 words

What if TypeScript knew exactly which query parameters your URL contained — and their values — purely from the string itself? Here's how advanced types and ts-toolbelt make that possible.

  • TypeScript
  • Type Inference
  • Template Literal Types
read-postopen
24
typescript

Leveraging Union Types and Union Autocomplete Helper in TypeScript

Dec 6, 2023· 1 min·183 words

Combining string literals with a bare string kills autocomplete. Here's the pattern that preserves it — plus a reusable helper type to apply it anywhere.

  • TypeScript
  • Union Types
  • Autocomplete
read-postopen
25
typescript

A Deep Dive Into TypeScript's Infer Keyword

Dec 4, 2023· 3 min·540 words

The infer keyword lets TypeScript make educated guesses about types inside conditional types. Understand it through detective analogies and practical examples.

  • TypeScript
  • Conditional Types
  • Infer
read-postopen
26
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
27
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
28
typescript

Manipulating TypeScript Object Types with Omit and Pick Utility Types

Nov 21, 2023· 2 min·341 words

Need a new type based on an existing interface, minus a few fields? Omit and Pick make it trivial — here's how each works and when to reach for them.

  • TypeScript
  • Utility Types
  • Omit
read-postopen
29
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