Skip to content

v0.7.11

Choose a tag to compare

@github-actions github-actions released this 01 Oct 10:13
· 39 commits to main since this release

ExisJS Release v0.7.11

Release Date: 2026-10-01
Type: High-Performance Server Optimization, uWS Adapter Parity, Dev Server Configuration, Security & Scaffolding Alignment
Affected Packages: exisjs, create-exisjs


Highlights

  • Static Route In-Memory Fast Path:
    • NativeRadixTree now builds a dedicated static lookup map (staticCache) for parameterless routes (e.g. /, /api/health, /users/list).
    • Completely bypasses radix tree traversal for exact static routes, eliminating tree lookup overhead and delivering record-breaking sub-millisecond throughput (>51,000 req/sec).
  • Zero-Allocation AbortSignal Lazy Instantiation:
    • ExisRequest.prototype.signal is now lazily initialized on first access rather than allocated on every HTTP request.
    • Reduces object allocations, garbage collector pressure, and avoids attaching event listeners to IncomingMessage unless the route handler or middleware explicitly reads req.signal.
  • High-Performance uWS Adapter (uWebSockets.js) Parity:
    • Full compatibility and event lifecycle interface parity on UwsIncomingMessage, UwsServerResponse, and UwsWebSocketShim (.once(), .off(), .removeListener(), .removeAllListeners(), .destroyed, .writableEnded, .writeHead(), .getHeaders(), .getHeaderNames(), .flushHeaders()).
    • Seamlessly integrates with Node.js streaming ecosystems, connection abort listeners, and third-party middleware without type errors or event listener leaks.
  • Constant-Time Timing Safe Comparison (timingSafeEqual):
    • Added timingSafeEqual(a, b) in exisjs/middleware for comparing API keys, bearer tokens, HMAC signatures, and webhook secrets in constant time.
    • Implements constant-time dummy comparisons on length mismatch to eliminate length-leak side-channel timing attacks.
  • Configurable Dev Server Watcher (dev in exis.config.ts):
    • Added type-safe dev options in defineConfig (watch, ignored, usePolling, interval, binaryInterval).
    • Allows developers on Windows, Docker containers, WSL, and network shares to fine-tune file polling, watch directories, and ignore custom paths.
  • Flexible Database Lifecycle Registration:
    • registerDatabase now supports dual signatures: both registerDatabase(options) and registerDatabase(app, options), allowing modular dependency injection and root bootstrap patterns.
    • Standardized error cause assignment across Node.js runtime versions.
  • CLI Scaffolding Alignments (create-exisjs):
    • Updated project generator to scaffold scheduled tasks in src/cron/cleanup.ts utilizing the cron() helper and @Cron() decorator with CronExpression.EVERY_DAY_AT_MIDNIGHT.
    • Upgraded starter templates to exisjs: '^0.7.11'.

Key Improvements & Details

1. Timing-Safe String and Buffer Comparison

import { timingSafeEqual } from 'exisjs/middleware'
import { ForbiddenException } from 'exisjs/error'

export function verifyApiKey(req: ExisRequest) {
  const apiKey = req.headers['x-api-key'] as string
  if (!timingSafeEqual(apiKey, process.env.API_KEY)) {
    throw new ForbiddenException('Invalid API Key')
  }
}

2. Configurable Dev Watcher (exis.config.ts)

import { defineConfig } from 'exisjs/config'

export default defineConfig({
  port: 3000,
  dev: {
    usePolling: true,
    interval: 100,
    ignored: ['**/tmp/**', '**/*.sqlite*'],
  },
})

3. Flexible Database Lifecycle Registration

import { registerDatabase } from 'exisjs/database'
import mongoose from 'mongoose'

// Direct options registration
registerDatabase({
  name: 'mongodb',
  connect: async () => {
    await mongoose.connect(process.env.DATABASE_URL!)
  },
  disconnect: async () => {
    await mongoose.disconnect()
  },
  healthCheck: async () => mongoose.connection.readyState === 1,
})

4. Zero-Overhead Static Route Resolution

Static endpoints bypass tree traversals automatically:

import { route } from 'exisjs/router'

// Instant Map-based resolution with zero allocation overhead
export default [
  route.get('/', (req, res) => res.json({ status: 'healthy' })),
  route.get('/ping', (req, res) => res.send('pong')),
]

Full Changelog: v0.7.10...v0.7.11