Skip to content

feat(data-structures): stabilize RollingCounter - #7257

Open
tomas-zijdemans wants to merge 2 commits into
denoland:mainfrom
tomas-zijdemans:stabilize-rolling-counter
Open

feat(data-structures): stabilize RollingCounter#7257
tomas-zijdemans wants to merge 2 commits into
denoland:mainfrom
tomas-zijdemans:stabilize-rolling-counter

Conversation

@tomas-zijdemans

Copy link
Copy Markdown
Contributor

RollingCounter is feature-complete and the API has settled, so this promotes it to stable. It has been unstable since March (#7028), and every follow-up moved it toward patterns its stable siblings already use: serialization (#7074), at() and toArray() alignment (#7102), and the ReadonlyRollingCounter view plus instance clone path (#7234). What remains on the wishlist is convenience helpers, all addable post-stabilization as non-breaking additions. Same argument that stabilized Deque in #7092.

Mechanics, mirroring #7092:

  • Rename unstable_rolling_counter.ts to rolling_counter.ts (and the test file), drop the unstable- prefix from the export, re-export from mod.ts
  • Remove the @experimental tags
  • Point async/unstable_circuit_breaker.ts at the stable specifier

One thing deserves a hard look: stabilizing freezes RollingCounterSnapshot as a wire format, forever. It is a single field (segments, oldest to newest), and from() already accepts non-canonical layouts, but this is the one part of the API we cannot fix additively later. If the shape is wrong, now is the time.

No behavior changes. All 52 tests and the doc tests pass unchanged, and check_unstable_deps.ts confirms no stable module depended on the unstable specifier.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (df4d14d) to head (0b4a1aa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7257      +/-   ##
==========================================
- Coverage   95.03%   95.03%   -0.01%     
==========================================
  Files         619      619              
  Lines       51499    51752     +253     
  Branches     9301     9349      +48     
==========================================
+ Hits        48940    49180     +240     
- Misses       2021     2030       +9     
- Partials      538      542       +4     

☔ View full report in Codecov by Harness.
📢 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant