Journal
Engineering
21 posts
- Staff-Level React Architecture and Modern Refactoring: A Playbook for React 19.xA senior engineer's field guide to React 19.3: useActionState, useOptimistic, the React Compiler, ViewTransition, Fragment refs, and how to review async React code the way a staff engineer would.ReactPerformance33 min
- Push Notifications, Deep Linking and Device APIs in React Native: The Seams Nobody DocumentsPush notifications, deep linking and device detection each have a tidy quick-start page. In production they are one feature, and the bugs live in the seams: the cold-start race between a notification tap and a router that has not mounted yet, the channel you cannot edit after creation, and the URL you should not trust just because it arrived in a push payload.EngineeringReact Native11 min
- The Senior Frontend Engineering Blueprint, Part 8: Testing the App Router with Vitest, Playwright and Visual RegressionA green Vitest suite that calls render() on an async Server Component is either a compile error or a false positive. Here is the real testing pyramid for the Next.js App Router — Vitest, MSW v2, mocked Prisma, and a Playwright setup project that logs in once for the whole suite.EngineeringFrontend13 min
- The Senior Frontend Engineering Blueprint, Part 7: Building a Linear-Time Query Language ParserEvery product with a power-user search box eventually needs a real query language, and reaching for new RegExp(userInput) is how you end up hand-rolling a vulnerability. Here is a filter-query DSL built from a sticky-regex tokenizer, a recursive-descent parser, and a recursive Zod schema — with a ReDoS stress test to prove the O(N) claim.JavaScriptArchitecture11 min
- The Senior Frontend Engineering Blueprint, Part 6: Regex Engines, ReDoS and Defending Untrusted InputA validation regex that passes code review can still be an O(2^n) time bomb. Here is how V8's regex engine actually backtracks, the exact shape of pattern that wedges it, and the rest of the perimeter — Zod pipelines, parameterised SQL, DOMPurify, CSP — that a Next.js app needs around untrusted input.JavaScriptPerformance12 min
- The Senior Frontend Engineering Blueprint, Part 5: Edge Proxies, Auth.js Credentials and a Server-Side Data Access LayerA redirect from the edge feels like security, but an attacker can skip it entirely by calling your Server Action directly. Here is the request pipeline Next.js 16 actually runs, a Credentials-based Auth.js v5 setup with Prisma and RBAC, and the data access layer that is the only boundary that actually holds.ArchitectureEngineering13 min
- The Senior Frontend Engineering Blueprint, Part 4: Virtualising 50,000 Rows Without Losing AccessibilityRendering 50,000 DOM rows is a real performance problem, and virtualising them away is a real accessibility problem if you stop at the transform. Here is a generic VirtualList built from scratch, with the ARIA contract most implementations skip.ArchitectureReact10 min
- The Senior Frontend Engineering Blueprint, Part 3: Parallel Routes, TanStack Query and a Tailwind v4 Design SystemPart 3 of an eight-part build: the file-system pattern behind Instagram-style shareable modals, prefetching TanStack Query on the server and hydrating it on the client without a duplicate fetch, a Tailwind v4 @theme design system with a CVA button primitive, and why Core Web Vitals numbers stay aspirational until you actually reserve the layout space.ReactPerformance15 min
- The Senior Frontend Engineering Blueprint, Part 2: Server Components, Server Actions and Optimistic UIPart 2 of an eight-part build: where the Server/Client boundary actually goes, static pages that still regenerate themselves, the static-shell-plus-streaming-hole trade-off, and a webhook handler that verifies its own signature correctly.ArchitectureReact12 min
- The Senior Frontend Engineering Blueprint, Part 1: Docker, Strict TypeScript, and a Real Prisma Data LayerMost 'add a database' tutorials stop at new PrismaClient() and quietly ship a connection-pool leak the first time someone edits a file in dev. Part 1 of an eight-part series builds the foundation properly: Docker Postgres, a genuinely strict tsconfig, branded types, and a Prisma layer with cursor pagination and real transactions.ArchitectureTypeScript8 min
- Ads and One-Time Purchases in React Native: A Working Guide to RevenueCat, AdMob and the Failures That Cost Money SilentlyThe free app with a remove-ads purchase is the most common indie model there is, and almost every guide to it stops at the SDK calls. This is the rest: consent ordering, entitlement resolution, interstitial pacing, and the four ways an integration earns nothing while looking perfectly healthy.EngineeringReact Native16 min
- Self-Hosted SSO: Wiring authentik to Next.js 16 and Auth.js v5, Including the Logout That Does Not Log OutPutting an identity provider you own in front of your own applications is a weekend of work and a decade of consequences. Here is the whole mechanism — the discovery document, the id_token, the encrypted session cookie — and the single logout that Auth.js cannot perform at all.EngineeringSecurity13 min
- Self-Hosting Coolify: Migrating Real Apps, Wiring Cloudflare and What Build-on-Push Actually DoesCoolify gives you a Heroku-shaped button on a box you own. It is worth it — but only once you understand that you have not bought a platform, you have bought a generator for Docker and Traefik configuration, and it is Docker and Traefik that will page you.EngineeringDevOps13 min
- Building a Personal AI OS: File Watchers, Local IPC and Daemonised AgentsA terminal agent is a tool you visit. An AI OS is a set of small daemons that react to things happening on your machine. The difference is not the model — it is the event bus, the queue, and the discipline to keep every piece boring.AutomationAI8 min
- React Compiler Internals: How Auto-Memoisation Works, and Where It Gives UpThe compiler does not memoise your components by wrapping them in `memo`. It rewrites them into a cache-slot machine, and it does it only when it can prove your code follows the rules. Here is the proof it needs, and what breaks it.CompilersReact7 min
- Autonomous CI/CD: Letting an Agent Triage the Build Without Letting It ShipMobile release engineering is mostly the same six failures on repeat — a provisioning profile, a Gradle version, a flaky simulator. That is exactly the shape of work an agent is good at, provided you are ruthless about which half of the pipeline it can touch.AutomationCI/CD7 min
- Context Window Engineering: Compaction, Retrieval and Why Long Sessions DegradeA million-token window did not solve the problem, it moved it. Attention is not uniform, irrelevant context actively costs accuracy, and the skill that matters now is deciding what an agent is allowed to see.ArchitectureAI8 min
- Local-First Sync Engines: CRDTs, SQLite and Where the Write Boundary GoesOffline-first is not a caching problem, it is a distributed systems problem you moved onto a phone. The real decision is not which CRDT library — it is where writes become authoritative, and every sync engine answers that differently.ArchitectureEngineering8 min
- Next.js in 2026: The Flight Wire Format, Cache Components and Tag InvalidationReact Server Components do not send HTML and they do not send JSON. Here is what actually goes over the wire, how Cache Components replaced three separate flags, and the invalidation race that a single-argument `revalidateTag` used to hide.ArchitectureReact8 min
- React Native's New Architecture: JSI, Fabric and the Bridgeless TurboModuleThe bridge is gone — removed outright, not deprecated. What replaced it is a set of C++ abstractions with real performance characteristics, and a new generation of native modules that compile straight to JSI bindings.ArchitecturePerformance7 min
- Deterministic Multi-Agent Orchestration: Escaping the Infinite ReAct LoopAutonomous coding agents fail in a predictable way: context poisoning inside a freeform reason-act loop. The fix is not a better prompt — it is a finite state machine with programmatic gates, scoped tool access per phase, and automatic rollback.AutomationArchitecture9 min