Skip to content

Commit bb7489e

Browse files
committed
docs: document brotli library selection
Add a note around brotli artifacts
1 parent 9123653 commit bb7489e

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Readme.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,36 @@ and the `<title>` are all kept in sync reactively.
350350

351351
This is typically how you’d include your compiled Tailwind stylesheet.
352352

353+
## Brotli compression
354+
355+
Hyper uses [brotli4j](https://github.com/hyperxpro/Brotli4j) to compress both
356+
initial page responses and streaming SSE updates. The core `brotli4j` library is
357+
included as a dependency, but the **platform-specific native library** is not —
358+
you need to add the right one for your OS and architecture.
359+
360+
Add **one** of the following to your project's `:deps`:
361+
362+
| Platform | Dependency |
363+
|---|---|
364+
| macOS (Apple Silicon) | `com.aayushatharva.brotli4j/native-osx-aarch64 {:mvn/version "1.18.0"}` |
365+
| macOS (Intel) | `com.aayushatharva.brotli4j/native-osx-x86_64 {:mvn/version "1.18.0"}` |
366+
| Linux (x86_64) | `com.aayushatharva.brotli4j/native-linux-x86_64 {:mvn/version "1.18.0"}` |
367+
| Linux (aarch64) | `com.aayushatharva.brotli4j/native-linux-aarch64 {:mvn/version "1.18.0"}` |
368+
369+
For example, on an Apple Silicon Mac:
370+
371+
```clojure
372+
;; deps.edn
373+
{:deps {dynamic-alpha/hyper {:git/url "..."}
374+
com.aayushatharva.brotli4j/native-osx-aarch64 {:mvn/version "1.18.0"}}}
375+
```
376+
377+
If you deploy to a different platform than you develop on (e.g. dev on macOS,
378+
deploy on Linux), add both native deps — the correct one is selected at runtime.
379+
380+
If the native library is missing, you'll see an error like
381+
`UnsatisfiedLinkError` or `Brotli4jLoader` failure at startup.
382+
353383
## clj-kondo
354384

355385
Hyper ships with clj-kondo config. Import it with:

0 commit comments

Comments
 (0)