Skip to content

BareJS v0.2.7

Choose a tag to compare

@xarhang xarhang released this 30 Nov 09:39
· 100 commits to main since this release

What's New in v0.2.7

Added

  • Ergonomic file() 1-Liner Helper: app.get('/logo', () => file('public/logo.png')) with zero-copy Bun.file / Node streaming, optional root jail (blocks traversal & symlink escapes), null-byte rejection, and download header.
  • Generator Streaming (function* & async function*): Return sync or async generators directly for pull-based ReadableStream backpressure streaming (text, binary, NDJSON) with automatic gen.return() cleanup on client abort.
  • Declarative RouteSchemas.cookies Validation + OpenAPI 3.1: Fail-closed sync/async cookie validation & coercion with in: 'cookie' OpenAPI parameters.
  • Composable Plugin Macros (app.use(plugin)): Mounting a modular BareJS plugin inherits both routes and macros with full TypeScript inference.
  • Interactive Docs Site: Added cross-doc Ctrl+K / / Instant Search and sticky On This Page TOC on GitHub Pages.

Tests

  • 493 tests across 35 files (verified in CI across Bun, Node 20/22, and Deno 2).