How erhathaway/router-primitives works
Core Router Management Layer
• Manager (Central Controller)
• Router Base
• Action Executor
• Router Templates
• State Management
Router Primitives Layer
• Scene Router
• Stack Router
• Feature Router
• Data Router
State Management Layer
• Router State
• Router Cache
• Serialization/Deserialization
• History Management
Integration Layer
• Platform Bindings (React, Mobx)
• URL Management
• State Predicates
• Router Links
Top Level (Platform Integration)
[Platform Bindings (React/Mobx)] <---> [Router Manager] <---> [URL/Location Management]
Core Layer
[Router Manager]
• [Router Base]
• [Action Executor]
• [Router Templates]
• Scene
• Stack
• Feature
• Data
• [State Management]
• Router State
• Router Cache
• History
State Flow
[URL/Location] ──► [Serializer/Deserializer] ──► [Router State Tree] ──► [Application]
Important Elements to Highlight:
Special Notations
• A "State Predicates" component connected to Router State
• Router Links mechanism
• Cache management flow
Key Architectural Principles to Emphasize:
One-way Data Flow
• Location → Router State tree → Application
• Clear indication of state propagation
Modularity
• Separate primitive types
• Platform-agnostic core
• Pluggable template system
State Management
• URL as source of truth
• Caching mechanism
• History tracking
Integration Points
• Framework bindings
• Custom primitive creation
• Action handling
Additional Considerations:
Relationship between
• Router declaration objects
• Generated router instances
• URL structure
Animation integration
• State predicates
• Transition hooks
• Platform-specific animation bindings
• Nested components
• Clear text labels
• Proper grouping of related components