Skip to content

Commit 3fe94fd

Browse files
committed
feat: Introduce Phase 5 features for EasyAppDev.Blazor.Store
- Added comprehensive documentation for Phase 5: Killer Features, outlining enhancements in data fetching, mutable syntax, DevTools integration, and server-side state synchronization. - Implemented IStateValidator interface for custom state validation, including NoOpStateValidator and CompositeStateValidator. - Developed MessageSigner class for HMAC-based message signing to secure cross-tab and cross-origin communication. - Created SecurityOptions class to manage state validation and sensitive data filtering configurations. - Added SensitiveDataFilter for JSON serialization to prevent exposure of sensitive information.
1 parent de6f7eb commit 3fe94fd

28 files changed

Lines changed: 7195 additions & 23 deletions

docs/API_DESIGN_GUIDELINES.md

Lines changed: 474 additions & 0 deletions
Large diffs are not rendered by default.

docs/ARCHITECTURE.md

Lines changed: 598 additions & 0 deletions
Large diffs are not rendered by default.

docs/CODING_STANDARDS.md

Lines changed: 540 additions & 0 deletions
Large diffs are not rendered by default.

docs/DESIGN_PRINCIPLES.md

Lines changed: 461 additions & 0 deletions
Large diffs are not rendered by default.

docs/ROADMAP.md

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# EasyAppDev.Blazor.Store Roadmap
2+
3+
> The path from solid foundation to killer library
4+
5+
## Current State Assessment
6+
7+
**Version:** 3.0.0
8+
**Status:** Production-ready, actively maintained
9+
**Rating:** 9/10 - Feature-complete, production-ready with killer features
10+
11+
### What We Have
12+
- Zustand-inspired simplicity for Blazor
13+
- Immutable state via C# records
14+
- Thread-safe async-first updates
15+
- Middleware pipeline (DevTools, Persistence, Logging)
16+
- Selector-based granular subscriptions
17+
- Async action state machine (AsyncData<T>)
18+
- Debounce/Throttle/LazyCache utilities
19+
20+
### What's Been Added (Phase 4 & 5)
21+
- Optimistic updates with rollback
22+
- Undo/redo with history
23+
- Type-safe actions
24+
- Source generators
25+
- TanStack Query-style data fetching
26+
- Immer-style mutable syntax
27+
- Enhanced DevTools with time-travel
28+
- Plugin ecosystem
29+
- Server-side state sync
30+
31+
---
32+
33+
## Vision
34+
35+
**Goal:** Become the go-to state management library for Blazor - the one developers *want* to use, not the one they're forced to use.
36+
37+
**Philosophy:** Simple, Type-Safe, Pleasant
38+
39+
**Differentiators:**
40+
1. Simplicity of Zustand
41+
2. Type-safety of C#
42+
3. Developer experience that doesn't make you hate your life
43+
44+
---
45+
46+
## Phase Overview
47+
48+
| Phase | Version | Focus | Status |
49+
|-------|---------|-------|--------|
50+
| [Phase 1](phases/PHASE_1_BUG_FIXES.md) | 1.1.x | Bug Fixes & Polish | 🟢 Complete |
51+
| [Phase 2](phases/PHASE_2_CLEANUP.md) | 1.2.x | Cleanup & Simplification | 🟢 Complete |
52+
| [Phase 3](phases/PHASE_3_CORE_ENHANCEMENTS.md) | 2.0.0 | Core Enhancements | 🟢 Complete |
53+
| [Phase 4](phases/PHASE_4_ADVANCED_FEATURES.md) | 2.x | Advanced Features | 🟢 Complete |
54+
| [Phase 5](phases/PHASE_5_KILLER_FEATURES.md) | 3.0.0 | Killer Features | 🟢 Complete |
55+
56+
---
57+
58+
## Quick Links
59+
60+
### Planning Documents
61+
- [Phase 1: Bug Fixes & Polish](phases/PHASE_1_BUG_FIXES.md)
62+
- [Phase 2: Cleanup & Simplification](phases/PHASE_2_CLEANUP.md)
63+
- [Phase 3: Core Enhancements](phases/PHASE_3_CORE_ENHANCEMENTS.md)
64+
- [Phase 4: Advanced Features](phases/PHASE_4_ADVANCED_FEATURES.md)
65+
- [Phase 5: Killer Features](phases/PHASE_5_KILLER_FEATURES.md)
66+
67+
### Reference Documents
68+
- [Architecture](ARCHITECTURE.md)
69+
- [Design Principles](DESIGN_PRINCIPLES.md)
70+
- [Coding Standards](CODING_STANDARDS.md)
71+
- [API Design Guidelines](API_DESIGN_GUIDELINES.md)
72+
- [Testing Strategy](TESTING_STRATEGY.md)
73+
74+
---
75+
76+
## Phase 1: Bug Fixes & Polish (v1.1.x)
77+
78+
**Goal:** Fix known issues without breaking changes
79+
80+
### Key Deliverables
81+
- [x] Convert `AsyncData<T>` from class to record
82+
- [x] Add thread-safety to `MemoizedSelector<T>`
83+
- [x] Replace swallowed exceptions with proper logging
84+
- [x] Replace `Console.WriteLine` with `ILogger`
85+
- [x] Add XML documentation to all public APIs
86+
87+
**Breaking Changes:** None
88+
**Risk Level:** Low
89+
90+
[Full Details →](phases/PHASE_1_BUG_FIXES.md)
91+
92+
---
93+
94+
## Phase 2: Cleanup & Simplification (v1.2.x)
95+
96+
**Goal:** Reduce complexity, improve maintainability
97+
98+
### Key Deliverables
99+
- [x] Remove deprecated `Update()` method from Store, IStateWriter, and StoreComponent
100+
- [x] Extract diagnostics to separate package (deferred - using #if DEBUG conditional compilation)
101+
- [x] Consolidate DevTools overloads to single IServiceProvider method
102+
- [x] Slim down `StoreComponent<T>` - created `StoreComponentWithUtilities<T>`
103+
- [x] Add `UpdateWithAsync` extension method for simplified async patterns
104+
105+
**Breaking Changes:** Minor (deprecated APIs removed)
106+
**Risk Level:** Low-Medium
107+
108+
[Full Details →](phases/PHASE_2_CLEANUP.md)
109+
110+
---
111+
112+
## Phase 3: Core Enhancements (v2.0.0)
113+
114+
**Goal:** Add foundational features that enable advanced patterns
115+
116+
### Key Deliverables
117+
- [x] ISelector subscription on IStore - Subscribe using memoized selectors
118+
- [x] Functional middleware syntax - Use/UseWhen/UseForAction inline middleware
119+
- [x] MiddlewareContext - Rich context for middleware with phase info and services
120+
- [x] Improved PersistenceOptions API - Callbacks, transforms, and fine-grained control
121+
- [x] Structured error boundaries - StoreError record with ErrorLocation enum
122+
- [x] OnError handler in StoreBuilder - Centralized error management
123+
124+
**Breaking Changes:** Yes (major version bump)
125+
**Risk Level:** Medium
126+
127+
[Full Details →](phases/PHASE_3_CORE_ENHANCEMENTS.md)
128+
129+
---
130+
131+
## Phase 4: Advanced Features (v2.1.0)
132+
133+
**Goal:** Add powerful features for complex applications
134+
135+
### Key Deliverables
136+
- [x] Optimistic updates with rollback - `UpdateOptimistic`, `UpdateOptimisticWithConfirm`
137+
- [x] Built-in undo/redo - `IStoreHistory<T>` with `UndoAsync`/`RedoAsync`
138+
- [x] Type-safe actions/events - `IAction`, `IActionDispatcher<T>`, reducer pattern
139+
- [x] Cross-tab state sync - `WithTabSync` middleware using BroadcastChannel API
140+
- [x] Source generators for boilerplate - `[Store]` attribute generates setters/actions
141+
142+
**Breaking Changes:** Additive only
143+
**Risk Level:** Medium
144+
145+
[Full Details →](phases/PHASE_4_ADVANCED_FEATURES.md)
146+
147+
---
148+
149+
## Phase 5: Killer Features (v3.0.0)
150+
151+
**Goal:** Become the undisputed best Blazor state library
152+
153+
### Key Deliverables
154+
- [x] TanStack Query-style data fetching - UseQuery, UseMutation, QueryClient
155+
- [x] Immer-style mutable syntax - Produce() with Draft pattern
156+
- [x] Full DevTools time-travel debugging - Enhanced middleware with action replay
157+
- [x] Plugin ecosystem - IStorePlugin, PluginHost, built-in plugins
158+
- [x] Server-side state sync - SignalR-based real-time sync with presence
159+
- [ ] Visual Studio / Rider tooling (Future enhancement)
160+
161+
**Breaking Changes:** None (additive)
162+
**Risk Level:** Medium (well-tested)
163+
164+
[Full Details →](phases/PHASE_5_KILLER_FEATURES.md)
165+
166+
---
167+
168+
## Success Metrics
169+
170+
### Adoption
171+
- GitHub stars growth
172+
- NuGet download trends
173+
- Community contributions
174+
- Stack Overflow questions
175+
176+
### Quality
177+
- Test coverage > 90%
178+
- Zero critical bugs in production
179+
- Documentation completeness
180+
- API stability
181+
182+
### Developer Experience
183+
- Time to first working app < 5 minutes
184+
- Learning curve feedback
185+
- Migration ease from other libraries
186+
187+
---
188+
189+
## Principles Guiding Development
190+
191+
1. **Simplicity over features** - Don't add complexity unless it solves real problems
192+
2. **Immutability is non-negotiable** - Every API must preserve immutability
193+
3. **Type-safety first** - Leverage C# compiler, no magic strings
194+
4. **Async by default** - Synchronous is the exception
195+
5. **Fail gracefully** - Never crash the app for optional features
196+
6. **Test everything** - If it's not tested, it's broken
197+
198+
---
199+
200+
## Contributing
201+
202+
See each phase document for specific contribution opportunities. Priority areas:
203+
- Bug fixes (Phase 1)
204+
- Documentation improvements
205+
- Test coverage expansion
206+
- Sample applications
207+
208+
---
209+
210+
## Changelog
211+
212+
| Date | Update |
213+
|------|--------|
214+
| 2025-12-01 | Phase 5 completed - v3.0.0 released (Query system, Immer syntax, Enhanced DevTools, Plugins, Server sync) |
215+
| 2025-12-01 | Phase 4 completed - v2.1.0 released (Optimistic updates, Undo/Redo, Actions, TabSync, Source Generators) |
216+
| 2025-12-01 | Phase 3 completed - v2.0.0 released |
217+
| 2025-12-01 | Phase 2 completed - v1.2.0 released |
218+
| 2025-12-01 | Phase 1 completed - v1.1.0 released |
219+
| 2024-12-01 | Initial roadmap created |
220+
221+
---
222+
223+
*This roadmap is a living document. It will evolve based on community feedback, real-world usage patterns, and the Blazor ecosystem evolution.*

0 commit comments

Comments
 (0)