block 1.2.0 copy "block: ^1.2.0" to clipboard
block: ^1.2.0 copied to clipboard

Blob-compatible binary data blocks with platform-optimized implementations for web and io.

Unreleased #

1.2.0 #

Released: 2026-03-13

Features #

  • Expose FileBlock as a public VM API via package:block/io.dart.
  • Add FileBlock.open() and FileBlock.openRange() for lazy file-backed block views.
  • Accept dart:io File directly in Block(List<Object> parts, ...) on IO platforms.

Behavior #

  • Make file-backed IO parts lazy to open while preserving reusable file-backed views.
  • Make the default BlockBase.arrayBuffer() fallback materialize from stream() instead of requiring the reverse direction.

Documentation #

  • Add VM file-backed usage examples to the README.
  • Document stream() as the preferred lazy integration path for downstream runtimes.

1.1.0 #

Released: 2026-02-24

  • #8 Refactor internals to a flattened lib/src layout with thinner io/web lazy backends, reduced copy overhead, and improved benchmark performance.

1.0.0 #

Released: 2026-02-06

BREAKING CHANGES #

  • Reset the package to a minimal Blob-compatible API:
    • Block(List<Object> parts, {String type = ''})
    • size, type, slice(), arrayBuffer(), text(), stream()
  • Removed legacy memory/cache/dedup/public management APIs.
  • Removed legacy helper exports (MemoryManager, DataStore, DisposableBlock, ByteDataView, etc.).

Added #

  • Platform-specialized implementations under one package via conditional imports.
  • web implementation that wraps native Blob (package:web).
  • io implementation using temp files + finalizer cleanup.
  • io slice strategy:
    • copy for <= 64KB
    • shared backing for > 64KB
  • New VM/web contract tests and Flutter integration test coverage.

0.0.4 #

Unreleased

Bug Fixes #

  • Fixed issue with Stream-based blocks when creating multiple slices
  • Added caching mechanism to _StreamBlock to support multiple accesses to non-broadcast streams
  • Updated documentation with best practices for handling large files with streams

Improvements #

  • Added data deduplication feature to optimize memory usage when storing identical blocks
  • Added public API to view deduplication statistics and memory savings
  • Improved memory management under memory pressure conditions
  • Added comprehensive tests for stream caching functionality
  • Enhanced README examples for processing large files

0.0.3 #

Released: 2025-03-03

Bug Fixes #

  • Fix typo: renamed formStream method to fromStream for better API consistency

0.0.2 #

Released: 2025-03-03

Improve code comments

0.0.1 #

Released: 2025-03-02

Initial stable release of the Block package.

5
likes
150
points
537
downloads

Documentation

API reference

Publisher

verified publishermedz.dev

Weekly Downloads

Blob-compatible binary data blocks with platform-optimized implementations for web and io.

Repository (GitHub)
View/report issues

Topics

#binary #blob #streams #web #io

License

MIT (license)

Dependencies

web

More

Packages that depend on block