Skip to main content

GRAPH_CACHE_VERSION

Constant GRAPH_CACHE_VERSION 

Source
pub const GRAPH_CACHE_VERSION: u32 = 33; // 33u32
Expand description

Persisted graph cache schema version.

Bump this whenever the serialized shape of the persisted graph (any of the graph types that derive serde for the cache, the manifest types, or the store envelope) changes, so a stale graph-cache.bin written by an older binary is rejected rather than deserialized into the wrong shape.

Bump it for import-resolution semantics changes too, not only for wire-shape changes. The manifest compares this constant, the cache mode, and per-file fingerprints, and carries no binary version, so a cache written before a classification change replays the old classification verbatim on an unmodified tree and silently hides the new behaviour. The same applies to plugin config extraction, which seeds entry points and path aliases.

Bumped to 17 for issue #2031: cached resolver output retains canonical test-root replacements and ESM/CommonJS mechanisms, while profiled graphs retain target-sparse reachability masks plus exact compact reference routes. Ordinary graphs omit unused provenance. Versions 7 through 16 were used by published development commits for this change, so the final version remains 17 rather than reusing a potentially stale intermediate cache version.

Bumped to 18 for issue #2083: reference provenance moved out of SymbolReference into the per-export reference_paths side table, changing the persisted layout of every export’s reference list.

Bumped to 19 for issue #2084 (PR #2096): profiled test-reachability masking now falls back to the legacy fail-open classification when a graph would need more than the mask-profile cap, so caches written by the unbounded profiling code must not replay their old profiled results on large monorepos where the cap now engages.

Bumped to 20: cached re-export edges now carry the enclosing statement span and the source string-literal span used to anchor unresolved-import findings on the specifier. Warm 19 caches lack both spans.

Bumped to 21: persisted module graphs now carry the canonical effective export index used for named and star re-export resolution. Warm 20 caches lack that index and would replay the previous propagation semantics.

Bumped to 22: effective export names are interned once per graph and type and value resolutions share one compact key. Warm 21 caches contain the allocation-heavy intermediate index layout.

Bumped to 23: effective bindings distinguish direct declarations, namespace objects, and implicit SFC default exports.

Bumped to 24: namespace-object bindings retain their source module so consumers can enumerate the namespace through the canonical index.

Bumped to 25: export references retain their semantic Type or Value namespace so one named re-export surface can route both without duplicate graph symbols.

Bumped to 26: the effective export index retains typed declaration merge groups for namespace-aware reference selection.

Bumped to 27: declaration merge groups are stored once and referenced by a compact per-slot group identifier instead of cloning every group per slot.

Bumped to 28: reference-site deduplication now includes the exact import span, so one consumer can retain multiple distinct imports of one binding.

Bumped to 29: resolved semantic facts retain directly required structural type members used to protect explicit interface implementations.

Bumped to 30: declaration-merge references now propagate through named and star barrel surfaces using the canonical effective binding group.

Bumped to 31 for issue #2213: speculative __mocks__ sibling candidates that resolve to package space are no longer emitted, so warm 30 caches would keep replaying the phantom @scope/__mocks__ package edges the resolver no longer produces.

Bumped to 32: the effective export index resolves the type namespace in two lanes (real declarations and value-derived fallbacks), stores a per-file name index, and retains opaque bindings for known external named and namespace re-export surfaces. Warm 31 payloads neither describe the same structure nor carry those external bindings, so a consumed barrel export could be falsely reported as unused.

Bumped to 33 for issue #2225: speculative root-level __mocks__/<specifier> candidates from factory-less bare-specifier mocks now resolve to project files. Warm 32 caches lack those edges, so root manual mocks would stay reported as unused files.