1.4.28 is a focused release around streaming behavior, file responses, and a cluster of response/cookie validation fixes. The biggest user-facing changes are better backpressure for streamed responses and proper Range support for File/Blob responses.
What's new
-
Streamed responses now use pull-based backpressure instead of eagerly draining the source generator. This prevents unbounded buffering when an async generator produces data faster than the client can consume it, which is especially relevant for SSE and large upstream proxy streams (#1803).
-
FileandBlobresponses now honor theRangerequest header. Elysia supports standard byte-range forms, returns206with the rightContent-Range/Content-Lengthheaders for partial responses, and returns416for invalid out-of-bounds ranges (#1802). -
Type customization for TypeBox errors is easier to extend.
ElysiaTypeCustomErrorsis now exported so you can add custom error message typings through module augmentation, while still keeping autocomplete for known string templates (#1613). -
More schema helpers are available from the package root.
AnySchema,UnwrapSchema, andModelsToTypesare now exported directly, which simplifies importing shared schema and model utility types.
Fixes
-
Dynamic imports used inside
.guard()now register their routes correctly instead of being dropped before the guarded routes are attached to the parent app (#1805). -
HTML imports work again in Bun when the response path goes through inline promise handling.
-
Error responses produced through response mapping are now awaited correctly, so async error-to-response conversion no longer gets lost (#1797).
-
Cookie validator configuration now correctly merges app-level cookie settings with route-level cookie validation instead of ignoring application defaults (#1794).
-
Custom parser lookup now checks the full parser name, which fixes parser resolution for multi-character parser configurations (#1796).
-
Transformed cookie values are now written back to the cookie entry correctly during validation/decoding (#1795).
-
Cookie
noValidatechecks now use the cookie schema instead of the wrong schema source (#1793). -
Response encode validation now throws a
ValidationErrorinstead of a boolean, so validation failures propagate with proper error information (#1792). -
When Elysia sets headers for string or object responses, it now does so conditionally when
set.headershas not already been provided, avoiding unintended header overrides.
Other notable changes
- Bun-specific builds were removed.
Contributors
@MarcelOlsen, @MegaManSec, @ap0nia