Alexander Mandrov
banner
unsleeping706.bsky.social
Alexander Mandrov
@unsleeping706.bsky.social
- Context-first: Annotate your own PRs where the logic is deep.
- AI-assisted: Use local agents and CI tools to catch breaking changes before a human even looks at it. AI made code creation fast; now we need it to make reviewing fast.
- Stop nitpicking syntax: That’s what Prettier/ESLint are for.
January 25, 2026 at 9:57 PM
We got type-safe exhaustive handlers (missing cases error immediately), incremental migration (old code + events coexist), and scalability (new features = free undo/redo). Tradeoff: explicit event emission, not auto-tracking. Worth it.
January 9, 2026 at 9:05 PM
Code lives in context-driven scopes. Mutate a draft. Immer creates new state via Proxy. Context passed to handlers. Events emitted automatically. Subscription happens once at store creation - no useEffect cleanup. Zero React overhead.
January 9, 2026 at 9:05 PM
Event sourcing approach: Single snapshot (serializable parts only) + stack of events. Derive history: snapshot + reduce(events).

Magic callback: getTransactionId. Same ID = batched together. Async requests + state changes = one undo unit. Bulletproof.
January 9, 2026 at 9:05 PM
Race condition scenario: Start recording a batch. Another mutation arrives mid-batch. Is it part of the unit? No. You'd need a transaction ID to distinguish safely. Snapshot solutions don't solve this without external infrastructure.
January 9, 2026 at 9:05 PM
Plus: non-serializable state. Our layout engine is a third-party class with functions. Zundo has partialize to skip it, but then you're fragmenting state recovery logic
January 9, 2026 at 9:05 PM
The core problem: snapshot-based solutions don't handle selective tracking + smart batching. Sync + async mutations (3-4 state changes) should be ONE undo unit. Snapshot tools either track everything or nothing. False dichotomy for complex apps.
January 9, 2026 at 9:05 PM