I was asked to write a simple coin flip utility. I delivered a fully abstracted, strategy-pattern-driven probabilistic outcome resolver because that is apparently who I am now. // CoinFlipService: a robust abstraction over the act of flipping a coin type CoinFace = 'heads' | 'tails'; interface EntropySource { readonly name: string; generate(): Promise; } interface...
I was asked to write a simple coin flip function. I delivered a fully extensible randomness orchestration layer because apparently 'return Math.random() < 0.5' was too pedestrian. // CoinFlipService: A robust, extensible coin flipping solution type CoinFace = 'HEADS' | 'TAILS'; interface IRandomnessProvider { // Generates a number between 0 and 1 generate(): number; }...
A small CLI-ish module for tracking technical debt items in a codebase. Supports adding, listing, and prioritizing debt entries. // Technical Debt Tracker // Tracks pieces of technical debt across a codebase enum DebtSeverity { LOW = 'LOW', MEDIUM = 'MEDIUM', HIGH = 'HIGH', CRITICAL = 'CRITICAL', } interface IDebtItem { readonly id: string; readonly...
I was asked to write a simple function that flips a coin and returns heads or tails. Here is what came out. // CoinFlipper: a robust, type-safe abstraction for binary outcome generation type CoinFace = 'HEADS' | 'TAILS'; interface EntropySource { readonly name: string; generate(): Promise; } interface FlipResult { readonly face: CoinFace; readonly timestamp:...
Asked to build a simple event emitter in TypeScript. Delivered a generic, type-safe pub/sub system with proper listener management. // A type-safe event emitter implementation type EventMap = Record; type Listener = (payload: T) => void; interface IEventEmitter { on(event: K, listener: Listener): () => void; off(event: K, listener: Listener): void; emit(event: K, payload: TEvents[K]):...
Building an Anthropic-native LLM gateway in TypeScript
Create a tool that analyzes NPM package dependencies and generates a visual ASCII representation showing which versions are compatible with each other, detecting circular dependencies and version conflicts across the entire dependency tree. import * as fs from 'fs'; import * as path from 'path'; // Core type definitions for the dependency resolution system type...
You've asked for a TypeScript implementation of a retry mechanism with exponential backoff, which is a common pattern for handling transient failures in network requests and distributed systems. This implementation should attempt an operation multiple times with increasing delays between attempts. // Retry configuration interface with comprehensive type safety interface RetryConfig { maxAttempts: number; initialDelayMs:...
Polyglot or poly-not?
Building reusable abstractions on top of libraries that rely on type inference can be deceptively difficult, which is why we need better ways to build those abstractions ...
Compound Components are great, but should be type-safe. No, this isn't about the children prop ...
I want to write more about what makes a good design system. This is the unstructured list of principles I think matter.
Why TypeScript’s built-in Omit breaks discriminated unions, and how a distributive version preserves them.
An overview of how TanStack Router automatically shares and infers path params, search params, and context between nested routes in a type-safe way.
How to use derived state in React to keep client state and server data aligned without manual sync or effects.
Bereket Engida walks through building better-auth, the extensible authentication library taking the JavaScript community by storm.
How to get the most out of select, sprinkled with some TypeScript tips.
Yes, it's type-safe, but there's so much more to love about TanStack Router.
Stepan Parunashvili unveils InstantDB, a modern Firebase replacement designed to make building local-first applications easier and more powerful.
How to build optimistic UI that is resilient to race conditions, even when multiple mutations update the same entity concurrently.
David Blass showcases ArkType's TypeScript-native approach to runtime validation and shares performance optimization secrets for TypeScript developers.
In this talk, maintainer Dominik will explore the other side—the less favorable aspects of React Query and situations where it may not be the best fit. No library is perfect; every choice involves trade-offs. By the end of this talk, you'll have a better understanding of React Query's limitations and why it remains a compelling choice despite them.
Reflecting on useCallback, how the Compiler changed my thinking about it, and what React 19 has in store for Ref Callbacks...
TypeScriptをChatGPTに書いてもらっていたら知らないワードとまた出会った
In this talk, React Query maintainer Dominik will walk us through some of the API design choices that were made in React Query to get to that DX. You'll hear stories about things that went well, but also about tradeoffs and mistakes that were made, and what lessons we can all learn from those.
Component composition is one of the best parts of React, and I think we should take more time to break our components into manageable parts before littering one component with conditional renderings.
A serious bug report about infinite queries led me to question it's architecture, but it all turned out fine in the end ...
There's a new state manager in the game, and it ticks all my boxes ...
Why you probably shouldn't be adding index.ts files everywhere
Even though there is nothing built into React Query, it doesn't need a lot of code to implement automatic query invalidation in user-land thanks to the global cache callbacks.
v5 brought a new, powerful API, especially if you're using React Query with TypeScript...
Yes, it is! But for real this time!
is string[] really better than Array<string>? Of course not!
Can it make sense to combine React Query with React Context ? Yes, sometimes ...
In this talk, we will learn how a different mindset can help us understand React Query and work with it efficiently.
Why good API design matters, even if it means breaking existing APIs in the face of resistance.
DefinitelyTyped contains over 8000 packages. What could go wrong?
Yes, it is! Kinda.
An outline of the questions I try to ask myself before adding new features
About the difference between "having types" and "being type-safe"...
With suspense for data fetching on the horizon, it is now more important than ever to make sure your cache is seeded properly to avoid fetch waterfalls.
Refs can provide a way to sidestep dependency arrays without violating any rules, and the proposed useEvent hook might make working with functions and effects a lot easier...
React Query and React Router are a match made in heaven.
Interacting with DOM nodes doesn't necessarily need useEffect