Changelog
Binary JSON (BJSON) Improvements
- Optimized BJSON Functions: Improved performance and memory usage for
bjsonEncode()
andbjsonDecode()
operations - Direct Memory Access: BJSON functions now work with raw buffers for better efficiency instead of going through ArrayBuffer wrappers
Crypto API Support
crypto.getRandomValues()
: Generate cryptographically strong random values for Uint8Array, Uint16Array, Uint32Array, and other typed arrayscrypto.randomUUID()
: Generate RFC 4122 compliant UUID v4 stringscrypto.randomUUIDv7()
: Generate UUID v7 with timestamp-based ordering- Supports custom timestamp parameter for deterministic generation
- Maintains lexicographic sort order based on creation time
Enhanced Intrinsics
- Crypto Intrinsic: New
Crypto: true
option in context intrinsics to enable the Crypto API
Improvements
Type System
- Reduced Bundle Size: Replaced tree-shakable enums with constants to improve bundle size and loading performance
- Cleaner Type Definitions: Simplified type definitions while maintaining full type safety
🐛 Bug Fixes
Module Evaluation
- Fixed Module Evaluation: Reverted two-pass code evaluation that slowed down code
- Promise Handling: Improved promise state handling in module evaluation to properly return module namespaces
Error Handling
- Better Error Messages: Enhanced error reporting for BJSON operations and crypto functions
- Exception Cleanup: Improved exception handling and memory cleanup in various scenarios
🔄 Breaking Changes
API Changes
- BJSON Method Signatures:
bjsonEncode()
andbjsonDecode()
now work with raw Uint8Array instead of ArrayBuffer - Enum to Constants: Some enums have been replaced with constants - existing code should continue to work but may need type updates