Skip to content

Use DisposableStack for resource cleanup#98

Merged
shgysk8zer0 merged 1 commit intomasterfrom
feature/dispose
Feb 27, 2026
Merged

Use DisposableStack for resource cleanup#98
shgysk8zer0 merged 1 commit intomasterfrom
feature/dispose

Conversation

@shgysk8zer0
Copy link
Member

Introduce DisposableStack-based lifecycle management for the barcode scanner: createBarcodeScanner now accepts a base (DocumentOrShadowRoot) to find video elements by id and an optional stack to manage disposables. Internals now adopt/defer abort controllers, wake lock and media stream via a DisposableStack/AsyncDisposableStack, attach stack disposal on abort, and surface a disposable on the returned scanner object. index.js start() was converted to async and updated to use a DisposableStack for start/stop handling. CHANGELOG updated and package.json version bumped to 1.2.3 with dev dependency version bumps.

Description and issue

Please add relevant sections (Added, removed, changed, fixed) to CHANGELOG.md

List of significant changes made

Introduce DisposableStack-based lifecycle management for the barcode scanner: createBarcodeScanner now accepts a `base` (DocumentOrShadowRoot) to find video elements by id and an optional `stack` to manage disposables. Internals now adopt/defer abort controllers, wake lock and media stream via a DisposableStack/AsyncDisposableStack, attach stack disposal on abort, and surface a disposable on the returned scanner object. index.js `start()` was converted to async and updated to use a DisposableStack for start/stop handling. CHANGELOG updated and package.json version bumped to 1.2.3 with dev dependency version bumps.
@shgysk8zer0 shgysk8zer0 added the enhancement New feature or request label Feb 27, 2026
@shgysk8zer0 shgysk8zer0 self-assigned this Feb 27, 2026
@shgysk8zer0 shgysk8zer0 merged commit 9c3d8cc into master Feb 27, 2026
6 checks passed
@shgysk8zer0 shgysk8zer0 deleted the feature/dispose branch February 27, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant