Hi there, I'm Adrian!
I'm a
For 6 years I've been building fast, accessible web apps in TypeScript, React and Next.js. I understand how the browser and JavaScript engine work underneath - so what I ship runs fast and stays easy to maintain.
Categories
Browse by category.
Worth reading
Posts I think are a good starting point
Popular Tags
Topics with the most posts
Recent Posts
Latest from the blog
-
The illusion of understanding: why writing reveals what you actually know
You feel like you understand closures - until you sit down to explain them step by step. Then a gap opens up. Cognitive scientists called it the illusion of explanatory depth: our sense of knowing is systematically inflated, and it only shows when you have to reconstruct the mechanism. On why writing - and better yet, building something that runs - is the best test of what you actually know.
6 min read
-
Big-O without the math: what your code really costs
Your code runs perfectly on ten items and stutters on ten thousand - even though not a single line changed. Big-O doesn't tell you "how fast," only "how the cost grows as the amount of data grows." How to spot the shape of that growth in everyday frontend code - and how to turn a loop inside a loop into something that doesn't slow down on large data.
9 min read
-
Why good technical decisions lose to the business
The best technical decision can still lose - because it was put the wrong way. The business doesn't buy "clean code"; it buys cost, risk and time. How to translate refactors, tech debt and "good enough" into those three measures - and when "no" is the right answer.
8 min read
-
How an answer types itself out word by word: streaming over HTTP
An AI answer appears gradually not because of a visual effect but because of streaming: an HTTP response body is a stream, so the server can send it in chunks and the browser can show each one right away. On the front end you read it two ways - the dead-simple
EventSource(SSE) or the flexiblefetchwith a stream - and it's the second one that the LLM libraries use under the hood.7 min read
-
Where cache lives: how many copies of one response exist at once
The same server response can sit in several caches at once - app memory, the Service Worker, the HTTP cache, the CDN - and the whole page is held by bfcache on top of that. Each has a different owner and something different clears it, so "clear cache" hits one of them, sometimes none. What's left is the question every such debugging session starts with: which layer is holding the stale copy, and what invalidates it.
9 min read
-
Service Worker - code that answers instead of the server
Turn off the internet, refresh the page - and it still works. Behind that is the Service Worker: a separate script that steps between the page and the network and intercepts every request for a file before it reaches the server. It decides whether to answer from the network, from its own cache (
Cache API), or on its own terms - and from that one decision come all the caching strategies, offline mode, and the classic 'after a deploy the user sees the old version' trap.12 min read
-
HTTP caching: why the second visit to a site is instant
Take a single
style.cssfile and follow its day on a live site: first the browser downloads it, then it serves it from memory without asking the server, then it asks the server whether its copy is still current and usually gets just a confirmation instead of the whole file, and after you deploy a new version it downloads it again. That one story is all of HTTP caching -Cache-Control,ETag,304, andstale-while-revalidate.10 min read
-
SSR, SSG, ISR, CSR: when the HTML is built, and at what cost
The four rendering strategies aren't a menu you pick once - they're a per-route decision about where the HTML is built and when. Each has a different generation moment, a different TTFB, a different infrastructure cost, and a different 'fresh data vs speed' trade-off. I unpack the mechanics of all four and show when each one makes sense.
22 min read
-
Same-origin policy and CORS: who can read data from another server
The browser's same-origin policy (SOP) blocks JavaScript on one page from reading data from another domain - unless the server explicitly allows it through CORS. This post walks through how that server-side permission mechanism works, why you sometimes see a preflight OPTIONS request, and why you sometimes don't.
12 min read
-
From HTML to pixel: how the browser renders a page
Every DOM element goes through five stages before you see it, regardless of the framework. Some styles trigger only the last stage; others trigger all five. That's the difference in animation cost - from a single composite step to a full reflow.
15 min read
-
Garbage Collection in JavaScript - how the engine cleans up after your code
Every object you create in JS takes up space in computer memory. JavaScript removes unused objects automatically, making room for new ones. But the engine sometimes can't tell that a given object is no longer needed - and then the object stays in memory. That's how memory leaks happen. A post about how this cleanup works (mark-and-sweep), the most common pitfalls, and when you actually reach for
WeakMaporWeakRef.16 min read
-
Event Loop in JavaScript - how the engine decides what runs next
JavaScript has one thread, but it can wait for many things at once. The trick is the event loop - a simple algorithm that picks what to run when the stack is empty. Microtasks beat tasks, render fits between cycles, and execution order starts to make sense.
18 min read
-
The this keyword in JavaScript - four binding rules in one place
thisin JS only looks weird because people look in the wrong place. Its value is decided at the moment of the call - and there are only four rules the call can pick from, plus arrow functions, which break out of the whole system.6 min read
-
async/await in JavaScript - how a function can wait without blocking the thread
async/awaitlooks like magic: you writeawait fetch(...), get the result on the next line, and the thread doesn't block for a single moment. Underneath there's no magic - just an old pattern of generator + Promise + auto-runner, hidden under the new keywordsasyncandawait.12 min read
-
Generators in JavaScript - a function that knows how to pause
A regular JS function runs top to bottom, returns a value, and disappears from memory. A generator is different - marked with
function*, it pauses on everyyield, hands a value out, and waits for the next.next(). A small change in the runtime, but it's the one that powers on-demand sequences and lives under the hood ofasync/await.11 min read
-
Hoisting in JavaScript - what the metaphor really means
The textbook explanation says declarations 'move to the top' of the code. The ECMA-262 spec doesn't define hoisting as a mechanism at all, and
letbehaves as if the rule didn't apply to it. So what really happens before your code runs, and why does the TDZ look exactly the way it does?10 min read
-
Execution Context and Call Stack - how JavaScript runs your code
Every line of JS has to run somewhere, every variable has to live somewhere, every function call has to come back to where it was called from. The engine keeps all of this in two structures - the execution context (where am I now) and the call stack (where did I come from). They're what closure, this, and async are all built on.
10 min read
-
new (and this) in JavaScript - what the keyword actually does
The new keyword in JS looks short, but behind it the engine runs four steps at once - creates an empty object, hooks up this, links it to the function's prototype, and returns the whole object back. Without new, you'd write the same thing by hand with Object.create.
17 min read
-
Promises in JavaScript - from callback hell to the microtask queue
Async in JS without Promises is callback hell - the code has no way to refer to the in-flight operation, and error handling sits separately inside every callback. A Promise stands in for a value that will arrive later - the code reads flat, and you catch errors in one place.
25 min read
-
Closure in JavaScript, or how a function can remember things
Functions in JS usually disappear together with their local memory. Closure breaks that rule - and it is the foundation for the module pattern, memoization, asynchronous JS, and private state without classes.
14 min read