Skip to content

v0.2.0

Choose a tag to compare

@petermueller petermueller released this 18 Mar 21:10
· 9 commits to main since this release
24798ae

Features

  • Encodable protocolBibbidi.Encodable with method/1 and params/1 for encoding command structs into BiDi wire format
  • Command structs — one struct per BiDi command (~60 total), each implementing Encodable, generated from the CDDL spec
  • Zoi schemas on command structs — every command struct exposes schema/0, opts_schema/0, and result_schema/0 for runtime validation, introspection, and auto-generated documentation
  • Typed facade specs — facade functions use real CDDL-derived typespecs (e.g. String.t()) instead of term(), and CommandName.opts() / CommandName.result() instead of keyword() / map()
  • Opts validation — facade functions validate keyword options via Zoi.parse!/2 before constructing command structs
  • Connection.execute/2,3 — accepts Encodable structs directly; existing function-based API is fully backwards-compatible
  • Telemetry[:bibbidi, :command, :start|:stop|:exception] events on Connection.execute/2 and [:bibbidi, :event, :received] on incoming BiDi events
  • mix bibbidi.gen.workflow — Igniter generator that scaffolds a Multi-style Op pipeline builder, Operation record, and sequential Runner
  • mix bibbidi.cddl.inspect — dev task for inspecting parsed CDDL rules, resolved fields, and extracted commands; now shows CDDL type info

Breaking

  • Bibbidi.Types.* modules removed — type information now lives directly on command structs (@type t, @type opts, @type result)
  • Connection.send_command/4 is now a documented low-level escape hatch — use Connection.execute/2 for normal usage
  • Commands.Session.end_session/1 renamed to Commands.Session.session_end/1Bibbidi.Session.end_session/1 is unchanged
  • Commands.Session.unsubscribe/3 changed to Commands.Session.unsubscribe/2events moved into keyword opts. Bibbidi.Session.unsubscribe/3 is unchanged
  • Script.evaluate/4Script.evaluate/5await_promise is now a required positional arg
  • Script.call_function/4Script.call_function/5await_promise is now a required positional arg, inserted before target
  • Bibbidi.Transport behaviour — added required send_pong/1 callback
  • All facade functions now validate opts with Zoi — unrecognized or wrongly-typed options will raise instead of being silently ignored

Changed

  • CDDL code generator migrated to Igniter for proper diffing, dry-run support, and formatting
  • Command module functions now construct structs internally and route through Connection.execute/2
  • Command structs use Zoi.Struct.enforce_keys/1 and Zoi.Struct.struct_fields/1

Fixed

  • Session.Unsubscribe struct now correctly includes events and subscriptions fields from the CDDL choice type
  • Bibbidi.Session.unsubscribe/3 no longer passes subscriptions: nil when the option is not provided

📦 Hex package · 📖 HexDocs