Skip to content

BareJS v0.2.5

Choose a tag to compare

@xarhang xarhang released this 30 Nov 06:18
· 120 commits to main since this release

What's New in v0.2.5

Added

  • Native TLS Support: Unified tls (ServeTlsOptions) in app.listen() & app.listenCluster() across Bun (Bun.serve({ tls })), Node.js uWebSockets.js (uWS.SSLApp), and Node.js https (node:https).
  • Zero-Node Edge Runtime (barejs/edge): Dedicated ./edge entrypoint (~195 KB, zero node:* imports) for Cloudflare Workers, Vercel Edge, and Deno Deploy.
  • Universal Standard Schema v1 (~standard): Native sync & async fail-closed validation for Valibot, ArkType, Zod 4, Effect, etc. across params, query, headers, body, and response.
  • Upgraded bareClient & bareTreaty: Non-throwing client.safe.* Result union, chained Proxy RPC (bareTreaty(app | url)), and typed WebSocket client (client.ws() / treaty.subscribe()) supporting both ws:// and in-memory BareJS.
  • GitHub Pages Documentation Site: Landing page & in-site Markdown docs reader at https://xarhang.github.io/bareJS/.

Security & Fixed

  • Stripped CR/LF (\r/\n) in Context.setHeader(), EdgeContext.setHeader(), EdgeContext.setCookie(), and EdgeContext.redirect() to prevent HTTP response splitting (zero-allocation fast path when clean).
  • EdgeContext.jsonBody() now returns 400 on malformed JSON instead of 500.
  • basicAuth() now sends RFC 7617 WWW-Authenticate: Basic realm="Restricted" on 401; added ctx.user setter and updated hasRole().

Tests

  • Added 7 new feature & security audit suites (483 tests / 6,740 assertions across 34 files).