Skip to content

refactor: remove await using - #29

Merged
brunozoric merged 2 commits into
mainfrom
bruno/refactor/remove-await-using
Jul 22, 2026
Merged

refactor: remove await using#29
brunozoric merged 2 commits into
mainfrom
bruno/refactor/remove-await-using

Conversation

@brunozoric

Copy link
Copy Markdown
Contributor

Summary

  • Replaced await using / AsyncDisposable on IReadStream with an explicit destroy() method
  • Converted all call sites (NdJsonReaderTool.parseFile, tests) to try/finally
  • Some bundlers choke on the explicit resource management syntax — this removes it without changing cleanup behavior

Changed files

  • src/node/features/ReadStreamFactory/abstractions/ReadStreamFactory.tsIReadStream no longer extends AsyncDisposable, adds destroy()
  • src/node/features/ReadStreamFactory/ReadStreamFactory.tsSymbol.asyncDisposedestroy()
  • src/node/features/NdJsonReaderTool/NdJsonReaderTool.tsawait using → try/finally
  • __tests__/node/ReadStreamFactory.test.ts — all tests updated to use try/finally + destroy()
  • Docs: README.md, AGENTS.md, feature README.md updated

Test plan

  • All 447 tests pass
  • Typecheck clean
  • Build clean
  • No memory/resource leak — destroy() calls same stream.destroy() that AsyncDisposable did

brunozoric and others added 2 commits July 22, 2026 13:34
Some bundlers don't support the `await using` syntax (explicit resource
management proposal). Replaced AsyncDisposable on IReadStream with a
plain destroy() method and converted all call sites to try/finally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric brunozoric self-assigned this Jul 22, 2026
@brunozoric
brunozoric merged commit 809c44a into main Jul 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant