Skip to content

v0.91

Latest

Choose a tag to compare

@azure-pipelines azure-pipelines released this 20 Nov 20:06
Immutable release. Only release title and notes can be modified.

New features

  • New built-in JSON/JSONC archive (about 3x faster than the previous RapidJSON-based archive):
    • Strict RFC 8259 JSON parsing and JSONC comments/trailing commas.
    • Native stream I/O for memory and files.
  • New standard type support:
    • std::variant serialization (initial implementation by @hoshinohikari):
      • Index-, name- and discriminator-based representations (VariantAsIndexed, VariantAsNamed, VariantAsDiscriminated).
      • Custom tag/content names and selectable default representation via SerializationOptions::variantOptions.
      • std::monostate.
    • std::basic_string_view<T> (save-only).
    • std::span (C++20; std::span<const T> is save-only).
    • std::chrono::year_month_day/hh_mm_ss (C++20).
  • New validators: GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, MultipleOf and Uuid.
  • Added PropertyValue wrapper that automatically chooses an XML attribute or an element/key-value depending on the archive.
  • More control over the representation of map-like containers:
    • Wrappers MapAsObject, MapAsDictionary and MapAsPairs.
    • Selectable default MapLoadMode via SerializationOptions::mapOptions.
  • Added BITSERIALIZER_DECLARE_STRING_TYPE for zero-copy serialization of custom string types:
    • Usable as map keys.
    • Supported by string validators and refiners.
  • Payload passthrough for the built-in JSON and MsgPack archives.
  • RapidYaml v0.16 support.

Changes

  • trimStringFields now applies to all string-like values; maxValidationErrors limits fields with errors rather than individual messages.
  • Loading a boolean from numbers greater than 1 now reports MismatchedTypes instead of Overflow.
  • SerializationException is preserved when ConvertByPolicy is used.
  • std::pair serialization no longer uses static locals, so custom allocators work correctly (thanks @hoshinohikari).
  • Significant performance improvements (thanks @Cyberex for testing on real ARM hardware):
    • fast_float parsing acceleration (optional; bundled in prebuilt packages).
    • Built-in JSON: SIMD scanning/escaping and buffered stream output.
    • CSV and MsgPack: SIMD CSV scanning and buffered MsgPack stream I/O.
    • Faster key comparison across archives.
  • SaveObject now honors the requested output type and supports output streams.

Breaking changes

  • Built-in JSON behavior differs from the deprecated RapidJSON archive:
    • Saving NaN/Infinity throws SerializationException (previously it did not produce a valid JSON value).
    • Raw payloads are stored as opaque JSON text (not a DOM); loading scans them only to determine their extent.
    • Saving re-emits the captured value verbatim without validation.
  • std::multimap is now saved as a dictionary by default; use MapAsPairs for the previous representation.

Deprecations

  • RapidJSON-based JSON archive; use BitSerializer::Json::JsonArchive (migration guide).
    • The archive remains available during the transition period.
  • ParsingException::Line/Offset -> line/offset.
  • CRawTime/CTimeRef -> UnixTime/TimeRef.
  • EnumAsBin -> EnumAsInteger (the old name remains available as a deprecated alias).

Bug fixes

  • Fixed PugiXml/RapidJSON array-scope edge cases and skipped array values in MsgPack.
  • Fixed TrimWhitespace for whitespace-only strings and Fallback copying of lvalue values.
  • Fixed validator messages and edge cases, including a GCC 14 -Warray-bounds warning in the Email validator.
  • Fixed UTF validation/detection, enum matching/numeric parsing and float-to-string precision for legacy compilers.
  • Fixed ToLowerCase/ToUpperCase to use locale-independent ASCII case conversion.
  • Fixed the fallback floating-point conversion path (legacy compilers without from_chars) to be locale-independent.
  • Fixed PugiXml wide-character mode (PUGIXML_WCHAR_MODE), which previously failed to compile in several paths.

Build and packaging

  • Added first-class Bazel support (MODULE.bazel/BUILD.bazel, integration tests and CI).
  • Bazel consumers pull PugiXml/RapidYAML only when they add those third-party modules explicitly; MsgPack-only builds stay free of them.
  • Prebuilt packages bundle fast_float headers and include the built-in JSON archive.
  • Release assets include the source tarball bitserializer_v0.91_src.tar.gz with a .sha256 checksum.