next.js
9f7f13be - Collapse NoopKvDb into an empty read-only TurboPersistence

Commit
98 days ago
Collapse NoopKvDb into an empty read-only TurboPersistence `noop_backing_storage()` now returns the same concrete type as the real `turbo_backing_storage()` — `KeyValueDatabaseBackingStorage<TurboKeyValueDatabase>` — built on an empty, read-only `TurboPersistence` instance that owns no on-disk state and never touches the filesystem. This eliminates the `Either<TurboBackingStorage, NoopBackingStorage>` wrappers at the napi binding and turbopack-cli call sites, removes one generic instantiation of every kv-backing-storage helper, and replaces the silent-drop write behavior of `NoopKvDb` with a loud bail via the existing `read_only` guard. `TurboPersistence::new` takes a new `empty` parameter that allocates the block caches with zero-sized buckets, avoiding the ~2 MiB of hash-table headroom they would otherwise reserve on the noop instance.
Author
Committer
Parents
Loading