Skip to content

feat(cache/unstable): add maxSize to TtlCache#7072

Open
tomas-zijdemans wants to merge 1 commit intodenoland:mainfrom
tomas-zijdemans:ttl-maxsize
Open

feat(cache/unstable): add maxSize to TtlCache#7072
tomas-zijdemans wants to merge 1 commit intodenoland:mainfrom
tomas-zijdemans:ttl-maxsize

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

@tomas-zijdemans tomas-zijdemans commented Mar 30, 2026

  • Adds optional maxSize option to TtlCache that evicts the oldest entry (by insertion order) when capacity is exceeded
  • Adds maxSize getter (returns Infinity when unset)
  • Adds #ejecting re-entrancy guard on set(), delete(), and clear() during onEject callbacks, matching LruCache

@github-actions github-actions bot added the cache label Mar 30, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.42%. Comparing base (1cd63ca) to head (7157291).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7072   +/-   ##
=======================================
  Coverage   94.41%   94.42%           
=======================================
  Files         630      630           
  Lines       50490    50530   +40     
  Branches     8949     8963   +14     
=======================================
+ Hits        47669    47711   +42     
  Misses       2249     2249           
+ Partials      572      570    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant