Skip to content

v0.7.9

Choose a tag to compare

@github-actions github-actions released this 24 Sep 08:59
· 38 commits to main since this release

ExisJS Release v0.7.9

Release Date: 2026-09-24
Type: Minor Feature, Enterprise OOP Architecture Upgrades & Bug Fixes
Affected Packages: exisjs, create-exisjs


Highlights

  • Enterprise OOP Architecture Upgrades:
    • Security & Authorization Decorators: Added first-class @Permissions(), @Roles(), and @Public() (@IsPublic(), @AllowAnonymous()) decorators with automated isSuperAdmin bypass and context propagation.
    • Service Lifecycle Hooks: Exported OnInit, OnDestroy, OnModuleInit, OnModuleDestroy, and OnApplicationBootstrap lifecycle interfaces, seamlessly invoked during application boot and graceful shutdown.
    • Off-Heap Method Caching: Added @Cacheable() and @CacheEvict() decorators powered directly by ExisJS's native off-heap Rust LRU cache (NativeMemoryCache).
    • Automatic Transaction Management: Added @Transactional() method decorator supporting ExisJS built-in DB, Prisma, Drizzle, TypeORM, Knex, and connection pools.
    • Performance Profiling: Added @Profile() decorator with sub-millisecond precision using performance.now().
    • Declarative Exception Filtering: Added @Catch(...exceptions) and @UseFilters() decorators with ExceptionFilter and ArgumentsHost interfaces.
    • Dual Class/Type Exception Declarations: Converted all HTTP exception aliases (NotFoundException, UnauthorizedException, ForbiddenException, BadRequestException, etc.) into proper subclasses that function simultaneously as runtime class constructors and TypeScript type annotations.
  • Route & Decorator Schema Normalization: Enhanced @Get, @Post, @Put, @Patch, @Delete, @Options, @Head, @All to gracefully accept raw TexEngine/Zod validation schemas as well as structured { body, query, params, headers } objects without TS(2559) errors.
  • Async Generator Type Safety: Standardized all starter templates in create-exisjs and CLI generators to emit explicit Promise<T> return types on async methods to resolve TS(1064).
  • Test Harness Enhancements: createTestApp and createTestContext now accept both App instances, ExisAppDefinition definitions, and ExisConfig configuration objects with shared boot promise memoization.
  • Dev Watcher Lockfile & Debounce Optimization: Configured chokidar in exis dev to ignore package lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock), cache dirs (.turbo, .next, .cache), and debounced reload events to eliminate restart loops during npm install.
  • ESM Multiline Import Path Resolution: Fixed regex in resolve-aliases.ts to support multiline import/export specifiers across line breaks during exis build.
  • Scaffolding Template Alignment: Standardized exis.config.ts generator template to export const config: ExisConfig and export default config.

Key Improvements & Details

1. Security & Permissions Decorators

import { Controller, Get, Post, Body, Permissions, Public, Use } from 'exisjs/decorators'

@Controller('/roles')
@Use(AuthGuard)
export default class RolesController {
  @Get('/public')
  @Public()
  async getPublic() { ... }

  @Post('/')
  @Permissions('role:create', 'role:manage')
  async createRole(@Body() body: CreateRoleDto) { ... }
}

2. Service Lifecycle Interfaces

import { Injectable, type OnInit, type OnDestroy } from 'exisjs/decorators'

@Injectable()
export class DatabaseService implements OnInit, OnDestroy {
  async onInit(): Promise<void> {
    await this.pool.connect()
  }

  async onDestroy(): Promise<void> {
    await this.pool.end()
  }
}

3. Native Off-Heap Method Caching

import { Injectable, Cacheable, CacheEvict } from 'exisjs/decorators'

@Injectable()
export class RoleService {
  @Cacheable({ ttl: 300, key: (id) => `role:${id}` })
  async findById(id: string): Promise<Role> {
    return this.db.query('SELECT * FROM roles WHERE id = $1', [id])
  }

  @CacheEvict({ key: (id) => `role:${id}` })
  async updateRole(id: string, data: any) {
    return this.db.update('roles', id, data)
  }
}

4. Automatic Database Transactions

import { Injectable, Transactional } from 'exisjs/decorators'

@Injectable()
export class OrderService {
  constructor(private db: DatabaseService) {}

  @Transactional()
  async placeOrder(userId: string, items: CartItem[]) {
    const order = await this.db.orders.create({ userId })
    await this.db.inventory.decrement(items)
    return order
  }
}

5. Performance Profiling

import { Injectable, Profile } from 'exisjs/decorators'

@Injectable()
export class ReportService {
  @Profile({ thresholdMs: 100, warnSlow: true })
  async generateReport() {
    return this.calculateMetrics()
  }
}

6. Declarative Exception Filters

import { Catch, UseFilters, type ExceptionFilter, type ArgumentsHost } from 'exisjs/decorators'
import { NotFoundException } from 'exisjs/error'

@Catch(NotFoundException)
export class NotFoundFilter implements ExceptionFilter<NotFoundException> {
  catch(exception: NotFoundException, host: ArgumentsHost) {
    host.res.status(404).json({
      code: 'NOT_FOUND',
      message: exception.message,
    })
  }
}

Full Changelog: v0.7.8...v0.7.9