Release 1.6.0
Breaking Changes
-
Paginator output structure: The paginator now enforces a standardized structure:
- Data is always placed under the
dataproperty (no longer configurable) - Metadata is now nested under the
metaproperty instead of being merged at the top level
- Data is always placed under the
-
Method renaming: Renamed
serialize()methods toresolve()onPaginator,Item, andCollectionclasses to better reflect their purpose. These methods build return values using transformers and resolve relationships rather than performing serialization (which happens during HTTP response transmission). -
Automatic JSON serialization: Transformer return values are now recursively JSON serialized. This means data types like
Dateobjects will be automatically converted to strings.
Features
-
Additional transformer parameters: You can now pass additional parameters to transformers for greater flexibility.
-
Type retention: Added support for retaining specific data types during type-level serialization via the
ExtendedJSONTypesinterface. For example, you can configure transformers to keepDateobjects asDateinstead of converting them to strings.
Improvements
-
Performance optimization: Significantly improved performance of recursive type resolution, reducing type instantiations from ~20,000 to ~1,700.
-
Build tooling: Migrated to
tsdownfor the build process.
Commits
- add support for passing additional data to transformers constructor e21761c
- cleanup types 7eef989
- cleanup types and JSON recursive serialization 55155c4
- omit base transformer methods when extracting variants b7b5124
- recursively resolve json types ad53980
- rename serialize methods on paginator, collection and item to resolve d4c8efe
Full Changelog: v1.5.0...v1.6.0