Writing
I write short notes on tools and habits that help with day-to-day engineering.
2026
- Remove useMemo and useCallback under the compilerCheck which components React Compiler optimizes and which effects depend on memoized values before removing useMemo or useCallback.
- Verify a Playwright healer locator fixInitialize Playwright Test Agents, run the healer on a renamed button, and verify the repaired test still fails when saving breaks.
- Read current props with useEffectEventRead the latest props in an Effect Event while keeping a React subscription tied to its real dependencies.
- Abort stale server fetches with cacheSignalPass React cacheSignal to a Server Component fetch so pending work can stop when its render ends.
- Keep tab drafts with React ActivityHide a React editor with Activity, keep the draft in memory, and let React clean up Effects while the editor is hidden.
- Read React's Chrome DevTools performance tracksRecord a slow click in Chrome DevTools, read React's Blocking lane in the Scheduler track, and trace the Render span to a component.
- Call server functions from TanStack Start loadersRead a server-only file with createServerFn and use the typed result in a TanStack Start route loader.
- Encode Uint8Array bytes as base64 or hexConvert Uint8Array bytes to base64, base64url or hex and decode them with the matching native methods.
- Improve paragraph breaks with text-wrap: prettyUse text-wrap: pretty to improve paragraph line breaks without adding manual breaks or nonbreaking spaces.
- import defer for lazy module evaluationUse TypeScript's import defer syntax to move module evaluation from startup to the first namespace property read.
- Share one AGENTS.md across coding agentsKeep repository guidance in AGENTS.md and import it from CLAUDE.md so Codex and Claude Code share the same instructions.
- Run TypeScript in Node without flagsRun a TypeScript script on Node 22.18 or later and use a separate compiler check to catch type errors.
- Publish to npm from CI without tokensSet up npm trusted publishing for a GitHub Actions release job and replace its long-lived publish token.
- Format Claude Code edits with a hookUse a Claude Code PostToolUse hook to run Biome format and lint on the file an Edit or Write call changed.
- Upgrade to Vite 7 on Node 22Pick a supported Node version for Vite 7, remove obsolete config options, and check the new browser build target.
- Share Biome config across a monorepoUse Biome 2 nested configs to inherit the root settings and override individual lint or formatter rules for each package.
- Run Oxlint before ESLintRun Oxlint before ESLint, move overlapping rules one at a time, and test that the second pass starts only on success.
- Choose a CSS value with if()Use CSS if() to pick a badge background from a custom property, with fallbacks for other tones and older browsers.
- Run one Vitest regression with an agentGive a coding agent a one-shot Vitest regression command, prove the named case fails, then rerun the full test file.
- Route URLs with the global URLPatternMatch a Node HTTP pathname with URLPattern, capture its numeric ID, and dispatch the request using the match result.