Chunked transfer encoding extension for htmx.
npm install htmx.ext...chunked-transfer[![CI][gha-image]][gha-url]
[![NPM version][npm-image]][npm-url]
[![Conventional Commits][conventional-commits-image]][conventional-commits-url]
> Chunked transfer encoding extension for htmx .
This extension adds Chunked transfer encoding to htmx requests.
\following https://github.com/bigskysoftware/htmx/issues/1911
``sh`
$ npm install htmx.ext...chunked-transfer
`html`
`html`
...
By default, chunks are appended to the target element. Use hx-chunked-mode="swap" to replace the previous chunk with each new one:
`html`
Append mode (default): Accumulates all chunks
` Loading... Loading... 50% Loading... 50% Done!`
Chunk 1:
Chunk 2:
Chunk 3:
Swap mode: Shows only the latest chunk
` Loading... 50% Done!`
Chunk 1:
Chunk 2:
Chunk 3:
Comment-only chunks (heartbeats) are automatically ignored:
` Content Contenthtml`
← Ignored, no DOM update
← Processed
← Processed (has content)
- Using Hono
- JSx SSR Suspense
`bashUnit tests
bun test
[npm-url]: https://npmjs.org/package/htmx.ext...chunked-transfer
[npm-image]: http://img.shields.io/npm/v/htmx.ext...chunked-transfer.svg
[gha-url]: https://github.com/douglasduteil/htmx.ext...chunked-transfer/actions/workflows/ci.yml
[gha-image]: https://github.com/douglasduteil/htmx.ext...chunked-transfer/actions/workflows/ci.yml/badge.svg
[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
[conventional-commits-url]: https://conventionalcommits.org*