Skip to content

v0.13.0

Choose a tag to compare

@github-actions github-actions released this 12 Jan 00:20
· 172 commits to main since this release
49df9af

Minor Changes

  • 1e7491c: Runtime Agnostic Streaming - Breaking API Change

    Changed APIs

    • writeToFile(path: string)writeToStream(stream: WritableStream<Uint8Array>)

      This change affects:

    • AssetDataReader.writeToFileAssetDataReader.writeToStream

    • Asset.writeToFileAsset.writeToStream

    • BaseAsset.writeToFileBaseAsset.writeToStream

    • BlobDataReader.writeToFileBlobDataReader.writeToStream

    • BufferDataReader.writeToFileBufferDataReader.writeToStream

      Migration Guide

      The caller is now responsible for creating the WritableStream using their runtime:

      Node.js:

      import { createWriteStream } from 'node:fs';
      import { Writable } from 'node:stream';
      
      const nodeStream = createWriteStream(outputPath);
      const writableStream = Writable.toWeb(nodeStream);
      await asset.writeToStream(writableStream);

      Removed Node.js Imports

    • Removed import { createWriteStream, WriteStream } from 'node:fs' from BlobDataReader.ts

    • Removed import { writeFile } from 'node:fs/promises' from BufferDataReader.ts

      This enables the library to be bundled for client-side applications (e.g., Next.js with Turbopack) without Node.js polyfills.