Laper 0.1.0 - Foundation
This release establishes the architectural foundation for Laper's collaborative editing system, featuring a complete TypeScript rewrite of the CRDT layer and real-time WebSocket synchronization.
CRDT TypeScript Unified Module
Single Source of Truth
- Complete TypeScript rewrite - All CRDT code migrated from JavaScript to TypeScript
- Unified entry point -
replaces scattered@shared/services/crdt
andcrdt-mirror/
importscrdt-loro/ - Type-safe operations - Compile-time verification of all data mutations
New Architecture
crdt/
├── schema.ts # Types + loro-mirror Schema + Factory functions + Loro initialization
├── types.ts # Loro container types + Context types + Connection state
├── mirror.ts # Mirror factory + Initial state
├── actions.ts # State mutation functions (Immer-style)
├── selectors.ts # State selectors (precise subscription, React components)
├── readers.ts # Direct readers (native LoroDoc, non-React context)
├── script.ts # loro-prosemirror integration
├── hooks.ts # React Hooks factory
└── index.ts # Unified export entry
Migration Highlights
deleted, migrated toschema.jsschema.ts- New constants:
,META_KEYS
,BEAT_FIELDS
,COVER_FIELDSSCHEMA_VERSION - New initialization functions:
,initLoroSchema()
,createEpisode()initEpisodeData()
Loro WebSocket Synchronization
Real-time Backend Sync
- LoroSyncClient - WebSocket single instance with 100ms batch processing
- Heartbeat mechanism - 54-second keep-alive for stable connections
- Version history API - HTTP endpoints for document history
Conflict Resolution
- CRDT-based merge strategy ensures conflict-free editing
- Automatic sync on reconnection with delta updates
- Offline-first architecture with local persistence
GEB Fractal Documentation Protocol
Three-Layer Structure
| Layer | Location | Responsibility |
|---|---|---|
| L1 | | Project constitution, module overview |
| L2 | | Local map, member list |
| L3 | File header comments | INPUT/OUTPUT/POS contract |
Mandatory Loop
Code change → Update L3 header → Check L2 CLAUDE.md → Update L1 if needed
Performance Optimizations
Drag & Drop
- DOM Reflow optimization - Reduced layout thrashing across all drag components
- CharacterBoardCanvas - Optimized drag performance with requestAnimationFrame
- Character relationship lines - Improved rendering efficiency
Canvas Improvements
- Canvas centering only on first mount, avoiding unnecessary recenter on data changes
- Batch state updates for smoother interactions
Technical Stack
- Frontend: React 19 + Vite 7 + Tailwind 4
- CRDT: Loro CRDT 1.8 (WASM) + loro-mirror
- Editor: ProseMirror 1.41
- Backend: Supabase 2.57 + Go/Gin
Breaking Changes
- Import path
→@shared/services/crdt-mirror@shared/services/crdt - Import path
→@shared/services/crdt-loro/schema@shared/services/crdt
now re-exports fromcrdt-loro/index.js
for compatibility@shared/services/crdt