The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Nothing has been published to npm yet; this becomes 0.1.0 at first release.
Until then, "changed" and "fixed" entries refer to the package as used
directly from the repository.
Added
- tus 1.0.0 core support as an htmx extension. Add
hx-ext="tus"and adata-tus-endpoint, and file inputs upload over tus instead of a normal htmx request. - Creation, Creation With Upload and Creation Defer Length, via
data-tus-endpoint,data-tus-metadata,data-tus-upload-data-during-creationanddata-tus-upload-length-deferred. - Checksum extension —
data-tus-checksumhashes every chunk with Web Crypto and sendsUpload-Checksum. Supportssha1,sha256,sha384andsha512. Implemented as an HTTP stack wrapper, exported ascreateChecksumHttpStack()for wrapping a stack of your own. - Expiration extension —
tus:expiresreports the server's deadline, anddata-tus-restart-on-expirystarts a fresh upload when the server reports the old one gone. Restarts at most once per file. - Concatenation across separate files —
data-tus-concatenateuploads each file as a partial upload and creates a final upload joining them.data-tus-parallelcontinues to split a single file across connections. - Termination —
data-tus-terminateon cleanup, plushtmx.tus.terminate(url)andhtmx.tus.abort(element, shouldTerminate). - Capability discovery —
data-tus-discoverissues theOPTIONSrequest tus-js-client never makes, reports the result throughtus:capabilities, and refuses files larger than the server'sTus-Max-Size. - Seventeen
tus:*events, all bubbling, covering the upload lifecycle, every HTTP request and response, retry decisions, expiry, discovery and concatenation.tus:should-retryis cancelable. - Auto-resume —
data-tus-auto-resumeresumes a previous upload of the same file, withtus:resumeandtus:auto-resume-error. - JavaScript API:
configure(),resetConfig(),activeUploads,terminate(),abort(),createChecksumHttpStack(), and the tus-js-client module re-exported astus. Available as ES module exports or onhtmx.tuswhen loaded from a script tag. - TypeScript declarations, including typed
detailpayloads for every event throughHTMLElementEventMapandDocumentEventMap. - Documentation at https://sitenetsoft.org/htmx-ext-tus/, generated from the README, with C4 architecture diagrams.
Fixed
- Retries never happened. The
onShouldRetryhandler returnednullwhentus:should-retrywas not canceled, and tus-js-client uses a handler's return value instead of its own default whenever one is present. No upload ever retried anddata-tus-retry-delayshad no effect, which defeated the point of a resumable upload client. The default decision is now reproduced faithfully: retry anything that is not a client error, except409and423, while the browser reports itself online. - Multi-file uploads could hang when one file failed, leaving the completion request unsent.
data-tus-complete-urlwas not inherited from ancestor elements.
Changed
- Renamed from
htmx-tustohtmx-ext-tusto follow the htmx extension naming convention used byhtmx-ext-sse,htmx-ext-wsand others. - Relicensed from Apache-2.0 to 0BSD, matching htmx and its official extensions.
Known limitations
- Checksum Trailer cannot be supported. No browser exposes an API for
sending HTTP request trailers. It is also unnecessary here: every chunk is
buffered before being sent, so the digest is always computable in advance
for the plain
Upload-Checksumheader. - Resuming after a page reload requires the file to be re-selected. tus URL storage persists the upload URL, not the file, and browsers will not reopen a local path without user action.
- Server support for extensions varies. Notably tusd implements neither
Checksum nor Expiration;
data-tus-discoverreports what a server actually offers.