dice-core
2026-02-27
Massive code quality overhaul with 27 rounds of review fixes, extraction, and deduplication
80 files · 8,729+ · 3,931-
Code quality infrastructure
5 files changed
eslint.config.jsESLint configuration with project-specific rules.prettierrcPrettier formatting configuration.prettierignorePrettier ignore patternspre-commitPre-commit hook running lint checksHANDOFF.mdHandoff document tracking review rounds and remaining work
- Established code quality tooling with ESLint, Prettier, and Husky pre-commit hooks
baseline
architectural
3 files
eslint.config.js.prettierrcpre-commit
Logger replacement
1 file changed
logger.tsReplaced custom logger with pino browser mode
- Replaced the custom logging implementation with pino browser mode for standardized structured logging
streamline
architectural
1 file
logger.ts
Simulation and physics overhaul
6 files changed
pre-simulate.tsMajor refactoring of pre-simulation with spawn config extraction, cancellation, and math fixespre-simulate-async.tsNew async pre-simulation wrapper with cancellation supportpre-simulate-worker.tsWeb worker for background pre-simulationspawn-configs.tsExtracted spawn configuration logic into dedicated moduleplayback.tsFixed playback snap, rotation correction, and settle guardsseeded-rng.tsAdded instance RNG and dual RNG streams for simulation vs presentation
- Extracted spawn configuration into a dedicated module, added async simulation with cancellation, and implemented dual RNG streams separating simulation from presentation randomness
decouple
architectural
3 files
spawn-configs.tspre-simulate-async.tsseeded-rng.ts
- Removed legacy pre-simulate-exact implementation that was no longer needed
deprecate
internal
1 file
pre-simulate-legacy-exact.ts
Component fixes across 23 review rounds
7 files changed
DiceArena.tsxFixed multi-fire guard, ref cleanup, rapierReady guard, SSR guardsDiceScene.tsxFixed stale closures, effect dependencies, abort handlingDiceRoller.tsxFixed prop forwarding and unmount guardsDie.tsxFixed material leaks, prop forwarding, spawn ceilingPlaybackDie.tsxFixed overlay double-rotation, stale texture refs, settle guards, ref truncationErrorBoundary.tsxImproved error boundary with better recoverydie-visuals.tsExtracted standalone die visuals module with material identity optimization
- Fixed dozens of component-level bugs including stale closures, material leaks, texture churn, spawn ceiling issues, SSR guards, and overlay rotation errors across 23 review rounds
harden
behavioral
4 files
DiceArena.tsxDiceScene.tsxPlaybackDie.tsxDie.tsx
Dice engine fixes
6 files changed
face-reader.tsFixed face reading with improved normal alignment and D4 special handlinggeometry-data.tsGeometry data fixes and deduplicationnotation-parser.tsParser fixes for edge cases and notation regex improvementstextures.tsFixed texture lookup and rendering issuesdefaults.tsCentralized physics constants and shared default valuesdice-configs.tsRefined per-die-type configurations
- Fixed face reader alignment for D4/D10/D100, improved notation parser regex for edge cases, resolved texture lookup issues, and centralized physics constants
remediate
behavioral
3 files
face-reader.tsnotation-parser.tstextures.ts
Physics layer replacement
1 file changed
rapier-init.tsNew shared Rapier initialization with retry logic
- Replaced the custom physics world and die-bodies modules with shared Rapier initialization, removing 800+ lines of custom physics code
decouple
architectural
1 file
rapier-init.ts
Test coverage expansion
6 files changed
pre-simulate-async.test.tsAsync pre-simulation tests including cancellationspawn-configs.test.tsSpawn configuration testsface-reader.test.tsExpanded face reader tests with D4/D10/D100 coveragenotation-parser.test.tsNew notation parser test suitetextures.test.tsTexture generation testslogger.test.tsLogger utility tests
- Significantly expanded test coverage with new suites for async simulation, spawn configs, face reader, notation parser, textures, and logger utilities
qualify
behavioral
2 files
pre-simulate-async.test.tsnotation-parser.test.ts
Type system cleanup
4 files changed
dice.tsExpanded dice type definitionsindex.tsConsolidated type exportsconfig.tsRefined configuration typesindex.tsCleaned up public API exports
- Cleaned up the type system by removing globals.d.ts, consolidating exports, and expanding dice type definitions
streamline
internal
3 files
dice.tsindex.tsindex.ts