Repository navigation
v0.7.10
ExisJS Release v0.7.10
Release Date: 2026-09-27
Type: Minor Feature, DI Reflection, Serialization Resilience, Validator Coercion & Error Standardization
Affected Packages: exisjs
Highlights
- Class Controller Inheritance (Base & Abstract Controller Support):
- Controllers can now extend abstract or base controllers with
@Controller()discovering all inherited route methods, parameter metadata, middlewares, lifecycle guards, interceptors, and exception filters across the full prototype hierarchy.
- Controllers can now extend abstract or base controllers with
- Property-Level
@Inject()and@Optional()Decorators:- Services, controllers, and modules support property injection directly on class fields (
@Inject(Token) public service!: Service) with TypeScriptdesign:typereflection fallback and@Optional()handling.
- Services, controllers, and modules support property injection directly on class fields (
- Forward References & Circular Dependency DI Resolution (
forwardRef):- Added
forwardRef(() => Target)and lazy ES6 Proxy circular dependency resolution in the DI container, resolving cyclic service dependencies seamlessly.
- Added
- Built-in Parameter Transformation Pipes &
@UsePipes:- Added
ParseIntPipe,ParseFloatPipe,ParseBoolPipe,ParseUUIDPipe,ParseArrayPipe,ValidationPipe, and the@UsePipes(...pipes)decorator for class, method, and parameter level data transformation.
- Added
@Global()Module & Provider Decorator:- Added
@Global()decorator for modules, making exported providers globally accessible across the entire application without redundant imports.
- Added
- Automatic Constructor Parameter Type Reflection via
design:paramtypes:- In OOP controllers and services, ExisJS automatically inspects TypeScript's emitted metadata (
Reflect.getMetadata('design:paramtypes', TargetClass)) and matches parameter classes directly againstINJECTABLE_REGISTRY. - Eliminates boilerplate
@Inject(Service)decorators on standard constructor parameters.
- In OOP controllers and services, ExisJS automatically inspects TypeScript's emitted metadata (
- Built-in Safe Response Serializer (BSON, Dates & Prototype Auto-Unwrapping):
- Added a zero-crash serialization engine (
safeSanitize) in the HTTP response pipeline. - Automatically unwraps Mongoose documents and ORM models via
.toObject({ virtuals: true, getters: true })or.toJSON(). - Automatically converts MongoDB BSON types (
ObjectId,Decimal128,Long,Binary), nativeBigInt(to string),Date(to ISO 8601), andMap/Setstructures. - Stack-based ancestor tracking prevents circular reference crashes (replacing cycles with
'[Circular]') without false-positive detection on shared directed acyclic graphs (DAGs).
- Added a zero-crash serialization engine (
- Enhanced Serialization Error Diagnostics:
- Automatically tracks object property paths during traversal (e.g.
'recentTransactions[0].accountId'), logging detailed diagnostic information for debugging un-serializable properties.
- Automatically tracks object property paths during traversal (e.g.
- Automatic Query Parameter Type Coercion:
- HTTP query schemas evaluated with
tex.number()andtex.boolean()automatically coerce incoming string query values (e.g.,?limit=100&active=true) into native numbers (100) and booleans (true), eliminating manual string parsing in route handlers.
- HTTP query schemas evaluated with
- Standardized Error Response Envelope:
- Standardized framework error responses (
HttpError, validation failures, authentication guard rejections) into a consistent JSON envelope:{ success: false, statusCode, error, message, validationErrors, errors, timestamp }.
- Standardized framework error responses (
- Smart ETag Disabling on Dynamic API Routes:
- Defaulted
etag: falseinexis.config.tsfor dynamic REST endpoints, eliminating redundant SHA-1 hashing CPU overhead and eliminating confusing 304 response timings in dev logs while keeping ETags configurable globally or per-route.
- Defaulted
- Reverse Proxy & Multi-CDN Client IP Header Resolution:
- Enhanced
req.ipevaluation to prioritizeCF-Connecting-IP,True-Client-IP,X-Real-IP, andX-Client-IPbeforeX-Forwarded-ForwhentrustProxy: true(orprocess.env.TRUST_PROXY === 'true'), ensuring rate limiters and IP filters identify real client IPs behind Cloudflare, AWS ALB, NGINX, and Render.
- Enhanced
- Test Harness Client Enhancements:
- Updated
createTestAppclient HTTP methods (client.get,client.post, etc.) to accept optional request options (e.g. custom headers likeclient.get('/ledger', { headers: { 'if-none-match': '"etag"' } })).
- Updated
Key Improvements & Details
1. Automatic Parameter Type Reflection & DI Auto-Resolution
import { Controller, Get, Param } from 'exisjs/decorators'
import { UserService } from './user.service'
@Controller('/users')
export default class UserController {
// No @Inject() boilerplate required! Auto-resolved via design:paramtypes + INJECTABLE_REGISTRY
constructor(private readonly userService: UserService) {}
@Get('/:id')
async getUser(@Param('id') id: string) {
return this.userService.findById(id)
}
}2. Built-in Safe Response Serializer (Mongoose & BSON)
import { Controller, Get } from 'exisjs/decorators'
import { UserModel } from './user.model'
@Controller('/users')
export default class UserController {
@Get('/active')
async getActiveUsers() {
// Automatically unwrapped via .toObject() and ObjectIds converted to strings!
// No .lean() or manual mapping needed.
return UserModel.find({ isActive: true })
}
}3. Automatic Query Type Coercion
import { Controller, Get, Query } from 'exisjs/decorators'
import { tex, type ResolveSchema } from 'exisjs/validator'
export const ListQuerySchema = tex.object({
page: tex.number({ default: 1 }),
limit: tex.number({ default: 20 }),
active: tex.boolean({ optional: true }),
})
export type ListQueryDto = ResolveSchema<typeof ListQuerySchema>
@Controller('/items')
export default class ItemController {
@Get('/', { query: ListQuerySchema })
async listItems(@Query() query: ListQueryDto) {
// query.limit is number (100), query.active is boolean (true)
return { query }
}
}4. Standardized Error Response Envelope
{
"success": false,
"statusCode": 400,
"error": "Bad Request",
"message": "Validation Error: limit: Must be a number",
"validationErrors": {
"limit": "Must be a number"
},
"errors": {
"limit": "Must be a number"
},
"timestamp": "2026-09-27T10:11:42.000Z"
}5. Multi-CDN & Reverse Proxy Client IP Resolution
import { defineConfig } from 'exisjs/config'
export default defineConfig({
// Evaluates CF-Connecting-IP, True-Client-IP, X-Real-IP, and X-Forwarded-For
trustProxy: true,
etag: false, // Smart ETag default for mutable REST APIs
})Full Changelog: v0.7.9...v0.7.10