The first project-ready preview of Melange, featuring major performance optimizations (2-5x faster list operations), comprehensive testing, and TypeScript support.
Highlights
Performance Optimizations (2-5x Faster)
Significant performance improvements to list operations, particularly for schemas with userset references and exclusion patterns:
- DirectExclusion: 1.9ms → 0.4ms (4.75x faster)
- Userset with exclusion: 3.2ms → 1.1ms (2.9x faster)
- Complex closure: 2.5ms → 0.8ms (3.1x faster)
Optimizations include CTE-based exclusion precomputation, optimized userset checks, and cardinality hints for the query planner.
TypeScript Support
TypeScript is now a first-class language with:
- Client code generator (
melange generate client --language typescript) - Complete runtime implementation with caching and pagination
- Database adapters for
pgandpostgres.js - Over 90% test coverage
Developer Tools
- explaintest - Query performance analysis with EXPLAIN ANALYZE
- Enhanced dump-openfga-sql - View generated functions and debug code generation
- Multi-language integration tests - Automated cross-language compatibility verification
Documentation
- Complete godoc documentation for internal packages
- New TESTING.md contributor guide
- Architecture decision records inline with code
What's Changed Since v0.5.1
- CTE-based exclusion precomputation for 2-5x faster list operations
- TypeScript client code generator and runtime
- explaintest tool for query performance analysis
- Multi-language integration testing framework
- Enhanced benchmark infrastructure with faster data loading
- Complete godoc documentation
- Various bug fixes and stability improvements
Migration
No breaking changes - fully backward compatible with v0.5.1. Simply upgrade and run:
melange migrateGet Started
# Install CLI
brew install pthm/melange/melange
# For Go projects
go get github.com/pthm/melange/melange@v0.6.4
# For TypeScript projects
npm install @pthm/melange
melange generate client --language typescriptDocumentation | GitHub | npm