Skip to content

BREAKING(async/unstable): change Lazy.peek() return type, add AbortSignal support#7084

Merged
bartlomieju merged 6 commits intodenoland:mainfrom
tomas-zijdemans:lazy-improve
Apr 10, 2026
Merged

BREAKING(async/unstable): change Lazy.peek() return type, add AbortSignal support#7084
bartlomieju merged 6 commits intodenoland:mainfrom
tomas-zijdemans:lazy-improve

Conversation

@tomas-zijdemans
Copy link
Copy Markdown
Contributor

@tomas-zijdemans tomas-zijdemans commented Apr 4, 2026

  • AbortSignal support added to get()
  • Fixed a subtle bug where get() silently swallowed rejections by attaching a handler directly to the returned promise, suppressing unhandledrejection for uncaught callers.
  • peek() now returns  a discriminated union matching the Channel.tryReceive() convention. This resolves the type-level ambiguity when T includes undefined.

  • Error-reset semantic documented 

@github-actions github-actions Bot added the async label Apr 4, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.42%. Comparing base (224adef) to head (698a40b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7084   +/-   ##
=======================================
  Coverage   94.42%   94.42%           
=======================================
  Files         630      630           
  Lines       50533    50552   +19     
  Branches     8964     8969    +5     
=======================================
+ Hits        47717    47735   +18     
  Misses       2247     2247           
- Partials      569      570    +1     

☔ 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.

@tomas-zijdemans tomas-zijdemans changed the title BREAKING(async/unstable): refactor Lazy API refactor(async/unstable): Add AbortSignal support to Lazy.get() Apr 4, 2026
@tomas-zijdemans tomas-zijdemans changed the title refactor(async/unstable): Add AbortSignal support to Lazy.get() BREAKING(async/unstable): Add AbortSignal support to Lazy.get() Apr 4, 2026
@tomas-zijdemans tomas-zijdemans changed the title BREAKING(async/unstable): Add AbortSignal support to Lazy.get() BREAKING(async/unstable): change Lazy.peek() return type, add AbortSignal support Apr 4, 2026
Comment thread async/unstable_lazy.ts
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bartlomieju bartlomieju merged commit a3a6ef6 into denoland:main Apr 10, 2026
19 checks passed
tomas-zijdemans added a commit to tomas-zijdemans/std_cb that referenced this pull request Apr 10, 2026
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.

2 participants