This document provides a high-level overview of how the core components of Doh.js interact, from build-time analysis to runtime execution and reactivity. Understanding these relationships is key to effectively using and debugging Doh.js applications.
Doh's architecture is best understood as a series of interconnected layers, each building upon the last to provide a cohesive development and runtime environment.
Packages
and Modules
). It uses DohPath
to find files and applies Resolution Order
to understand dependencies, ultimately generating Manifests
. These JSON manifests are pre-computed blueprints of the application (dependency graphs, file lists, pattern maps) that the Load System consumes for fast runtime initialization. See Auto-Packager Details & Manifests DetailsDoh.load()
) & Doh.Loaded
: The runtime engine responsible for all resource management. Doh.load()
uses Manifests
and Resolution Order
to fetch and sequence resources (JavaScript, CSS, Patterns, Modules
, Packages
, etc.). These are populated into Doh.Loaded
, an in-memory runtime cache or virtual filesystem. Doh.Loaded
serves as the single source of truth for all loaded content, crucial for the Pattern Engine and HMR/HVFS. See Load System DetailsDoh.Loaded
cache, and then leverages Data Binding
(observe
/mimic
) to propagate these changes into live application objects and UI elements without requiring a page refresh. Data Binding can also be used independently for state synchronization. See HMR/HVFS Details & Data Binding DetailsResolution Order
to build reusable components. Patterns are object templates with multiple inheritance, melded properties, and defined lifecycles. Instantiated via New()
, they form the primary building blocks of application logic and UI, using resources from Doh.Loaded
. See Patterns OverviewResolution Order
principles for inheritance, allowing settings to be defined and overridden at various levels (e.g., environment, tenant). Configuration is accessed at runtime via Doh.pod
. See Pods DetailsThe interaction between these layers can be visualized as a flow from initial project setup to runtime operation and deployment:
Foundation & Discovery (Build-Time & Pre-Runtime):
DohPath
provides a consistent view of the file system, enabling reliable resource location.Auto-Packager
scans project files (including Packages
and Modules
) using DohPath
.Resolution Order
is applied by the Auto-Packager
to interpret dependencies and inheritance.Manifests
– optimized blueprints for the runtime.Pods
configuration is structured, also adhering to Resolution Order
for its hierarchy.Runtime Initialization & Execution:
Load System
(Doh.load()
) uses Manifests
and Resolution Order
to load resources (code from Modules
, Patterns
, assets) into the Doh.Loaded
cache.Pods
are loaded, making configuration available globally via Doh.pod
.Pattern Engine
facilitates the creation (New()
) and operation of Patterns
. These components, defined within Modules
, utilize resources from Doh.Loaded
and configuration from Doh.pod
to execute application logic.Runtime Reactivity & Updates (Primarily Development):
HVFS
monitors the file system for changes.HVFS
updates the corresponding resource in Doh.Loaded
.Data Binding
mechanisms (observe
/mimic
) then propagate these changes from Doh.Loaded
to active parts of the application (e.g., UI, stateful objects), often without a full page reload.Packaging & Sharing (Inter-Project Focus):
Dohballs
are generated. These are versioned, deployable snapshots of specific project folders (containing packages), created by the Auto-Packager
and build utilities. They are designed for consumption by other Doh projects, differing from the deployment of a full application to production (which would typically involve Git-based workflows or dedicated deployment tools).This overview helps you understand how changes flow through the system and how components depend on each other. Reference this map when exploring more detailed documentation about specific features.