Skip to content

Ghost Serialization 1.1.18

Choose a tag to compare

@juanchurtado1991 juanchurtado1991 released this 25 May 21:01
· 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 logic
    • StandardSerializeEmitter — objects with < 40 properties
    • FragmentedSerializeEmitter — chunked emission for large models
  • PerfectHashFinder extracted — compile-time brute-force hash optimizer now lives in its own object, with a full runtime walkthrough in KDoc
  • FlattenOptionsGenerator extracted — recursive nested-options generation for @GhostFlatten is now isolated, removing quadratic path-lookup overhead from GhostCodeGenerator
  • Cleaner generated variable names — removed leading underscore prefix from generated locals and mask fields: _resultresult, _mask0mask0, _fieldNamefieldNameValue. Eliminates Kotlin name-shadowing lint warnings in generated code
  • Bitmask literals hoisted to private const valMASK_FIELDNAME / MASK_DEFAULTS_N companion constants replace inline 1L shl N magic numbers, improving JIT friendliness
  • validateRequiredFields helper — 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
  • TypeHelpers KDoc pass — all extension functions now have individual KDoc comments

Changed

  • Ghost.deserialize(BufferedSource) rewritten to use acquireScratchBuffer / releaseScratchBuffer instead of the removed GhostPayload helper — zero extra allocations
  • Removed deprecated aliases Ghost.serializeToBytes() and Ghost.serializeToString() — use encodeToBytes() / encodeToString() directly
  • Gradle plugin DEFAULT_VERSION bumped to 1.1.18

Documentation

  • Full KDoc added to Ghost, GhostRegistry, GhostJsonException, JsonReaderOptions, InternalGhostApi, and GhostDoubleFormatter (complete algorithm walkthrough)
  • API Reference appendix added to the English manual covering all public types and methods
  • PDF manual regeneratedGhost-Serialization-Manual-1.1.18.pdf (46 pages)
  • Build scripts added under scripts/ for reproducible PDF generation

Fixed

  • CI — iOS: test-ios job 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"