Today I Learned

Daily reflections on work and learning—what I did and what I learned.

2026년 10월

2026-10-01

'Run only the related tests' is safe only when there is a rule that falls back to everything when you can't trust the graph

A record of switching the push hook and PR CI, which kept repeating the full unit test suite for every parallel job, to change-based selective runs, covering how to avoid guessing the base point and the rule that sends deletions and global config changes to a full run

  • Change-based test selection is an optimization that relies on the accuracy of the import graph, so it needs a rule that sends changes the graph can't be trusted for (deletions, renames, global config) to a full run
  • Don't guess the base point. CI uses the PR's base commit, the push hook uses the previous remote SHA that Git passes in, and for a new branch a person states it explicitly

2026년 9월

2026-09-25

I pressed two keys together twice and it dashed in only one direction — don't commit on the first event

Why committing the direction on the first key fails to merge the second key, since the browser sends keys pressed at the same time as separate keydown events, and how a 50ms collection window solved it

  • Even for keys pressed at the same time, the browser sends a separate keydown event for each key, in order
  • If you commit the result on the first key event, the second key cannot be merged as soon as a frame or simulation step slips in between the events

2026년 7월

2026-07-31

Legacy Browser Compat Is More Than babel Alone — the Multi-Layer Contract of Syntax, Polyfill, Conditional Load, and Smoke

What I learned fixing a bug where an app dies wholesale on a browser more than five years old — when several features die at once, suspect hydration; separate syntax down-leveling from runtime polyfills; load polyfills only on old browsers via feature-detect; and make the smoke run real interactions

  • When several UI features die at once, first suspect a common root cause like hydration/bundle parsing rather than separate bugs
  • Syntax down-leveling (babel) and runtime APIs (polyfill) are separate layers — a transpiler rewrites syntax but does not create missing functions
2026-07-07

Making Nested UI Re-renders O(1) — read-model, external store, and render-count tests

In an immutable-tree editor, editing a single line redrew everything; here's how I first pinned the problem with a test, then cut row and container re-renders with a normalized projection and per-id subscriptions

  • An immutable tree patch gives ancestors a new ref too, so passing props down triggers O(depth) re-renders — a normalized entry plus per-id subscription can cut it to O(1)
  • The entry cache must be stabilized by output value-equality, not input ref, and the external store sync must run synchronously at the choke point right before setState
2026-07-05

Block-Editor Ordering, Collaboration, and Keyboard Contracts

General patterns: fractional ordering, optimistic rebase, IME defer, keyboard undo delegation, scoped popover, Jest ESM shim, and more

  • For sibling ordering, a fractional position key + neighbor anchor + tie-break is better for concurrent inserts than an integer index.
  • Optimistic UI can't rebase without an inverse patch, and the remote seq must be the merge authority.