Knowledge

Reusable knowledge generalized from TIL, organized by category.

Search starts automatically 350ms after you stop typing.

97 documents

Updated 2026-08-23frontendInferred

TypeScript Variance — Covariance and Contravariance

The rules that decide whether Dog[] and (x: Dog) => void inherit the Dog-is-an-Animal relationship, and in which direction — plus why method shorthand syntax leaves a hole even with strictFunctionTypes on

Updated 2026-08-23testingInferred

Type-Level Testing — The Evidence the Compiler Leaves Behind

How to verify compilation instead of execution so that 'what wrong code does this type actually block' is pinned down in code, plus the @ts-expect-error and mutation checks that tell you whether the test is still alive

Updated 2026-08-23frontendInferred

Generic Context Factory

Working around the fact that a const declaration can't take type parameters — creating the context inside a generic function and letting the components capture it by closure, plus the trap where calling it during render silently remounts everything

Updated 2026-08-14testingInferred

Test oracles and where correctness comes from

The problem of deciding whether a result is right or wrong, and why tests whose expected values were reverse-engineered from the implementation verify nothing

Updated 2026-08-09browserInferred

Message-based RPC in browser extensions

How to safely connect extension execution contexts that cannot share memory with message APIs, runtime validation, handler routing, response envelopes, and change notifications

Updated 2026-08-07operating-systemInferred

Symbolic links and the direct-run guard

Why a path-comparison main guard silently turns false behind a symlinked path such as an npm global bin, leaving a CLI that exits 0 with no output — and how to diagnose and fix it