How netflix/falcor works
Falcor is a client-side model for traversing and updating a JSON Graph, with an optional data source for missing data. The principal workflow is a caller issuing a model read, Falcor resolving paths against its cache and requesting missing data, then merging the response into the cache for the model response. The graph also preserves set, invalidation, dereferencing, and cache-maintenance capabilities. Evidence is limited to the README and the supplied excerpts and source index; edges without direct relationship evidence are omitted.
Main entry points: Model.js Falcor Model · setJSONGraphs.js JSON Graph merge · mergeJSONGraphNode.js Cache node merge · getBoundValue.js Bound value lookup
Components 20
Model API
- Falcor Model
lib/Model.js - Model responses
lib/response/ModelResponse.js - Bound models
lib/deref/index.js
Graph Access
- Path reads
lib/get/getValueSync.js - Bound value lookup
lib/get/getBoundValue.js - Path value writes
lib/set/setPathValues.js - JSON Graph merge
lib/set/setJSONGraphs.js - Path invalidation
lib/invalidate/invalidatePathSets.js
Remote Requests
- Request batching
lib/request/RequestQueueV2.js - Get request
lib/request/GetRequestV2.js - Read request cycle
lib/response/get/getRequestCycle.js - Set request cycle
lib/response/set/setRequestCycle.js - Configured data source
lib/typedefs/DataSource.js
Cache State
- JSON Graph cache
lib/ModelRoot.js - Cache node merge
lib/support/mergeJSONGraphNode.js - Cache maintenance
lib/support - LRU collection
lib/lru/collect.js - Reference type
lib/types/ref.js - Error prototype setup
lib/errors/applyErrorPrototype.js
Other components
- Application caller
Connections 17
- Application caller → Falcor Model: calls get
README.md - Falcor Model → Configured data source: configures source
README.md - Falcor Model → Model responses: returns response
lib/Model.js - Falcor Model → Request batching: uses queue
lib/Model.js - Get request → JSON Graph merge: merges response
lib/request/GetRequestV2.js - JSON Graph merge → Cache node merge: merges nodes
lib/set/setJSONGraphs.js - Path value writes → Bound value lookup: looks up bound value
lib/set/setPathValues.js - Path invalidation → Bound value lookup: looks up bound value
lib/invalidate/invalidatePathSets.js - Path invalidation → Reference type: checks references
lib/invalidate/invalidatePathSets.js - JSON Graph merge → Reference type: checks references
lib/set/setJSONGraphs.js - Cache node merge → Reference type: checks references
lib/support/mergeJSONGraphNode.js - Cache node merge → Cache maintenance: updates cache nodes
lib/support/mergeJSONGraphNode.js - LRU collection → Cache maintenance: removes cache nodes
lib/lru/collect.js - Read request cycle → LRU collection: collects cache
lib/response/get/getRequestCycle.js - Set request cycle → Path reads: reads model paths
lib/response/set/setRequestCycle.js - Bound models → Bound value lookup: resolves cache position
lib/deref/index.js - Falcor Model → JSON Graph cache: owns cache root
lib/Model.js