Back to Portfolio

Technical Insights

LinkedIn
State ManagementFeatured
Apr 2024•4 min read

Zustand + React Context: Scoped Component Stores

Solving singleton store conflicts in repeated components using Dominik Dorfmeister's pattern

Zustand works as a global singleton by default, which creates problems when initializing from props, reusing components like tables on the same page, or resetting state in tests. By wrapping a vanilla Zustand store inside React Context, each component gets an isolated store instance with automatic cleanup on unmount while keeping Zustand's selectors and performance.

#Zustand#React#React Context#State Management#Clean Code
Read Article
JavaScript InternalsFeatured
Oct 2024•5 min read

Tail Call Optimization (TCO) in JavaScript — Part 1: Concepts & The Accumulator Pattern

How tail calls and accumulator arguments protect recursive functions from stack overflow

A practical introduction to Tail Call Optimization (TCO) discovered while studying recursive algorithms. Explains what makes a call a true tail call, why standard recursion causes call stack overflows with large inputs like factorial(10000), and how refactoring with an accumulator argument enables tail-recursive execution.

#JavaScript#Recursion#TCO#Algorithms#Call Stack
Read Article
JavaScript Internals
Nov 2024•5 min read

Tail Call Optimization (TCO) in JavaScript — Part 2: Why Browsers Still Don't Support It

The engineering costs, debugging dilemmas, and Chrome vs. Safari debate behind TCO

Even when recursive code is written with proper tail calls, running it in Chrome or Firefox can still trigger a stack overflow. While TCO is part of the official ECMAScript spec, Safari (JavaScriptCore) is the only engine supporting it. Explores why V8 and SpiderMonkey opted out—due to low practical benefit, lost stack traces during debugging, and security concerns debated in 2016.

#JavaScript#V8 Engine#Browser Engines#Safari#Web Standards
Read Article
ArchitectureFeatured
Dec 2024•5 min read

Fundamentals of Front-End Architecture: Lessons from the Field

Applying software architecture, modular boundaries, and C4 diagrams to frontend codebases

Key takeaways from studying frontend architecture for a real-world dynamic codebase refactor. Covers what software architecture means for frontend apps, how to divide features into clean modules without overlap, sketching design diagrams with the C4 model before coding, and understanding the core distinction between Architecture and System Design.

#Frontend Architecture#System Design#Modular Code#C4 Model#Clean Code
Read Article