Ghost Serialization 1.1.18
·
637 commits
to main
since this release
What's Changed
Refactoring — KSP Compiler
- Serialization pipeline decomposed into dedicated modules mirroring the deserialization split from 1.1.16:
BaseSerializeEmitter— shared property / collection / value-class emit logicStandardSerializeEmitter— objects with < 40 propertiesFragmentedSerializeEmitter— chunked emission for large models
PerfectHashFinderextracted — compile-time brute-force hash optimizer now lives in its ownobject, with a full runtime walkthrough in KDocFlattenOptionsGeneratorextracted — recursive nested-options generation for@GhostFlattenis now isolated, removing quadratic path-lookup overhead fromGhostCodeGenerator- Cleaner generated variable names — removed leading underscore prefix from generated locals and mask fields:
_result→result,_mask0→mask0,_fieldName→fieldNameValue. Eliminates Kotlin name-shadowing lint warnings in generated code - Bitmask literals hoisted to
private const val—MASK_FIELDNAME/MASK_DEFAULTS_Ncompanion constants replace inline1L shl Nmagic numbers, improving JIT friendliness validateRequiredFieldshelper — required-field validation extracted into a dedicated inline function in generated serializers- Dead constant cleanup in
GhostEmitterConstants— 14 unused constants removed; new constants added for 1.1.18 emission patterns TypeHelpersKDoc pass — all extension functions now have individual KDoc comments
Changed
Ghost.deserialize(BufferedSource)rewritten to useacquireScratchBuffer/releaseScratchBufferinstead of the removedGhostPayloadhelper — zero extra allocations- Removed deprecated aliases
Ghost.serializeToBytes()andGhost.serializeToString()— useencodeToBytes()/encodeToString()directly - Gradle plugin
DEFAULT_VERSIONbumped to1.1.18
Documentation
- Full KDoc added to
Ghost,GhostRegistry,GhostJsonException,JsonReaderOptions,InternalGhostApi, andGhostDoubleFormatter(complete algorithm walkthrough) - API Reference appendix added to the English manual covering all public types and methods
- PDF manual regenerated →
Ghost-Serialization-Manual-1.1.18.pdf(46 pages) - Build scripts added under
scripts/for reproducible PDF generation
Fixed
- CI — iOS:
test-iosjob now trusts the Gradle exit code for Kotlin/Native tests, preventing false-positive failures when K/N output formatting changes
Upgrade from 1.1.17
# gradle/libs.versions.toml
ghost = "1.1.18"