DevelopmentJune 21, 2026· via DEV Community

Universal Uploader: Stream large files without blocking the main thread

Universal Uploader: Stream large files without blocking the main thread

Image : DEV Community

A new open-source library promises smoother file uploads by never loading the entire file into memory. Universal Uploader uses Fetch Duplex streams where supported and automatically falls back to a chunked XMLHttpRequest pipeline on browsers like Safari, all without external dependencies.

Built for speed and stability

Instead of buffering large files into browser memory, the library streams them in small chunks, keeping memory usage flat regardless of file size. When full duplex streams are unavailable, it switches to a resilient chunked XHR pipeline at runtime. The result is uninterrupted uploads even on slower connections or unstable networks.

Reliable upload lifecycle

Pause, resume, abort, and retry are built in, with exponential backoff for retries. A declarative React hook maps the entire process to state primitives, avoiding unnecessary re-renders. The codebase is covered by 127 integration and unit tests that cover network failures, stream interruptions, and state transitions.

Lightweight and modular

The library is written in vanilla TypeScript, weighs nothing at runtime, and is tree-shakable—unused upload strategies vanish during compilation. It ships as two packages: the core transport layer and a React integration.


Source: DEV Community. AI-assisted editorial synthesis — TechnoExpress.

Read the original source on DEV Community →

← Back to home