Skip to content

Improve dependency graph #1636

@gemcoder21

Description

@gemcoder21
 Here's a simplified text-based dependency graph:                                                                                                   
                                                                                                                                                     
  LEVEL 0 (No deps - compile first, parallel)                                                                                                        
  ┌─────────┐ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌───────┐                                                                                        
  │  Style  │ │ BigInt  │ │ Gemstone │ │ Keychain │ │ GRDB  │                                                                                        
  └────┬────┘ └────┬────┘ └────┬─────┘ └────┬─────┘ └───┬───┘                                                                                        
       │           │           │            │           │                                                                                            
  LEVEL 1          │           │            │           │                                                                                            
  ┌────┴─────┐     │           │            │           │                                                                                            
  │Components│     │           │            │           │                                                                                            
  └────┬─────┘     │           │            │           │                                                                                            
       │           │           │            │           │                                                                                            
  LEVEL 2          │           │            │           │                                                                                            
       │      ┌────┴────┐      │            │           │                                                                                            
       │      │Primitives│     │            │           │                                                                                            
       │      └────┬────┘      │            │           │                                                                                            
       │           │           │            │           │                                                                                            
  LEVEL 3 ─────────┼───────────┼────────────┼───────────┤                                                                                            
       │           │           │            │           │                                                                                            
  ┌────┴───┐ ┌─────┴────┐ ┌────┴─────┐ ┌────┴───┐ ┌─────┴──┐                                                                                         
  │Formatters│ │  Store   │ │GemstoneP │ │Preferen│ │ GemAPI │                                                                                       
  └────┬───┘ └────┬─────┘ └────┬─────┘ └────┬───┘ └────┬───┘                                                                                         
       │          │            │            │          │                                                                                             
  LEVEL 4        │            │            │          │                                                                                              
  ┌────┴───┐     │       ┌────┴────┐  ┌────┴───┐     │                                                                                               
  │Validators│    │       │Blockchain│  │Keystore│     │                                                                                             
  └────┬───┘     │       └────┬────┘  └────┬───┘     │                                                                                               
       │         │            │            │          │                                                                                              
  LEVEL 5 ───────┼────────────┼────────────┼──────────┤                                                                                              
       │         │            │            │          │                                                                                              
  ┌────┴─────────┴────────────┴────────────┴──────────┴──┐                                                                                           
  │              PrimitivesComponents (139 files)         │ ← BOTTLENECK                                                                             
  │   deps: Primitives, GemstonePrimitives, Components,   │                                                                                          
  │         Style, Localization, Validators, Formatters   │                                                                                          
  └──────────────────────────┬───────────────────────────┘                                                                                           
                             │                                                                                                                       
  LEVEL 6                    │                                                                                                                       
  ┌──────────────────────────┴───────────────────────────┐                                                                                           
  │                    ChainServices                      │                                                                                          
  │  (7 services: Node, Stake, Chain, Scan, Explorer...) │                                                                                           
  └──────────────────────────┬───────────────────────────┘                                                                                           
                             │                                                                                                                       
  ┌──────────────────────────┴───────────────────────────┐                                                                                           
  │                   FeatureServices                     │                                                                                          
  │ (23 services: Balance, Price, Wallet, Assets, NFT...)│                                                                                           
  └──────────────────────────┬───────────────────────────┘                                                                                           
                             │                                                                                                                       
  LEVEL 7 - FEATURES         │                                                                                                                       
  ┌──────────┬───────────┬───┴────┬──────────┬───────────┐                                                                                           
  │ Transfer │ Settings  │  Swap  │Onboarding│  Assets   │                                                                                           
  │(52 files)│(40 files) │(26 f.) │ (41 f.)  │ (18 f.)   │                                                                                           
  └──────────┴───────────┴────────┴──────────┴───────────┘                                                                                           
                                                                                                                                                     
  Critical Path (longest chain):                                                                                                                     
  BigInt → Primitives → Store → Blockchain → Signer → FeatureServices → Features                                                                     
           (8s)         (?)      (?)          (?)       (?)              (?)                                                                         
                                                                                                                                                     
  The Bottleneck:                                                                                                                                    
  - PrimitivesComponents waits for 7 packages before it can start                                                                                    
  - Most features depend on PrimitivesComponents                                                                                                     
  - This creates a "funnel" where parallelization is limited   
  - 
  Circular dependency issue:                                                                                                                         
  Blockchain → FeatureServices (NativeProviderService)                                                                                               
  ChainServices → FeatureServices                                                                                                                    
  FeatureServices → ChainServices                                                                                                                    
                                                                                                                                                     
  This cross-dependency between service packages adds complexity.                                                                                    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions