Skip to content

Commit 4fc41ff

Browse files
committed
feat(fiber): harden type safety, add scheduler + showcase
- Centralise all unsafe Lane/Lanes/Flags casts into src/fiber/bitwise.ts - Implement binary min-heap scheduler (O(log n)) in src/fiber/minHeap.ts - Wire concurrent rendering path (performConcurrentWorkOnRoot + renderRootConcurrent) - Simplify branded types: Lanes = Lane alias, HookEffectTag = number - Add 9 new test modules: bitwise, minHeap, typeGuards, lanes, scheduler, resumability, hydration, fiberUtils, commitIntegration - Add compile-time type enforcement test (types.typecheck.ts) - Export useMemo / useCallback / useReducer from index.ts - Build interactive browser showcase (examples/interactive-showcase/) - Update README: 473 tests, zero type errors, Phase 13 complete Typecheck: 0 errors Tests: 473 pass, 0 fail, 1,526 expects across 38 files
1 parent ac2a4fe commit 4fc41ff

32 files changed

Lines changed: 3879 additions & 907 deletions

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,28 @@ Each phase includes clear specifications, working implementations, and extensive
6060

6161
## Current Status
6262

63-
🆕 **Current Phase**: Stable Release Track - Phase 12**COMPLETE**
63+
🆕 **Current Phase**: Stable Release Track - Phase 13**COMPLETE**
6464

6565
**Latest Achievements**:
6666

67-
-**Phase 12 Complete**: Performance Optimization Suite - memo, useMemo, useCallback with comprehensive test coverage
68-
-**Enhanced Performance**: React.memo equivalent for component memoization and optimization hooks
69-
-**272 Tests Passing**: Comprehensive test suite covering all functionality including performance optimizations
70-
-**Zero Linter Issues**: Clean codebase with consistent formatting and biome configuration
71-
-**Complete Performance Toolkit**: memo, useMemo, useCallback hooks for production-grade optimization
72-
-**Production-Ready**: Robust error handling, TypeScript support, and comprehensive edge case coverage
73-
-**Package Preparation**: Ready for npm registry publication with performance features
67+
-**Fiber Reconciler**: Real React-like fiber architecture with work loop, begin/complete work, and commit phases
68+
-**Lane-Based Priorities**: Branded `Lane`/`Lanes` type system with priority scheduling and lane merging
69+
-**Scheduler**: Binary min-heap task queue with `scheduleCallback`, `shouldYield`, and priority levels
70+
-**Concurrent Rendering Groundwork**: `performConcurrentWorkOnRoot` with time-slicing support
71+
-**Type Safety Hardening**: Centralised unsafe-cast boundary (`bitwise.ts`), zero stray `as number` casts, compile-time enforcement
72+
-**473 Tests Passing**: Comprehensive test suite across 38 files with 1,526 expectations
73+
-**Zero Type Errors**: `bun typecheck` clean (0 errors)
74+
-**Interactive Showcase**: Live browser demo at `examples/interactive-showcase/`
7475

75-
**Stable Release Progress**: 1/9 phases complete (11% complete) 🚀
76+
**Stable Release Progress**: 2/9 phases complete (22% complete) 🚀
7677

7778
**Immediate Milestones**:
7879

79-
- 🚀 **npm Package Publication**: Package will be available on npm registry soon
80-
- 📦 **Alpha Release v0.1.0**: Complete core React-like functionality now available
81-
- 📚 **Documentation & Examples**: Comprehensive guides and demo applications
80+
- 🚀 **npm Package v0.3.0**: Published with fiber reconciler and performance toolkit
81+
- 📚 **Documentation & Examples**: Interactive showcase + updated API docs
82+
- 🧪 **Testing & Quality Assurance**: Phase 19 test coverage underway
8283

83-
**Post-Alpha Roadmap**: 12 additional phases planned for stable v1.0.0 release with advanced features including concurrent rendering, SSR, dev tools, and production optimizations.
84+
**Post-Alpha Roadmap**: 11 additional phases planned for stable v1.0.0 release with advanced features including concurrent rendering, SSR, dev tools, and production optimizations.
8485

8586
---
8687

@@ -378,7 +379,7 @@ const App = () => {
378379

379380
### 📋 Testing & Quality
380381

381-
- **261 Comprehensive Tests**: Full test coverage for all features and edge cases including all hooks
382+
- **473 Comprehensive Tests**: Full test coverage for all features and edge cases including all hooks
382383
- **TypeScript Support**: Full type safety with detailed type definitions
383384
- **Linting & Formatting**: Biome-based code quality and consistent formatting
384385
- **Error Handling**: Graceful degradation and helpful error messages
@@ -581,7 +582,7 @@ mini-react/
581582
- ✅ Advanced rendering (Portals, Fragments)
582583
- ✅ Production-ready reconciliation engine
583584
- ✅ Comprehensive TypeScript support
584-
-261 tests with full coverage
585+
-473 tests with full coverage
585586
- ✅ Developer-friendly API matching React patterns
586587
- ✅ npm package ready for publication
587588

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>MiniReact — Interactive Showcase</title>
7+
<link rel="stylesheet" href="style.css" />
8+
<link rel="preconnect" href="https://fonts.googleapis.com" />
9+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10+
<link href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=DM+Serif+Display&family=Inter:wght@400;500;600&display=swap" rel="stylesheet" />
11+
</head>
12+
<body>
13+
<div id="root"></div>
14+
<div id="portal-target" class="portal-target" aria-label="Portal target"></div>
15+
<script type="module" src="main.ts"></script>
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)