Releases: petermueller/bibbidi
Releases · petermueller/bibbidi
v0.3.0
Features
- Type modules (
Bibbidi.Types.*) — all named BiDi protocol types now have generated modules underBibbidi.Types.*with Zoi schemas (schema/0),@type t, and ExDoc documentation. Covers primitive aliases, string enums, struct-like maps, and choice/union types (~163 modules). - Improved command struct documentation — moduledocs include spec links, field descriptions with ExDoc cross-references to type modules (e.g.
t:Bibbidi.Types.Script.Target.t/0), and required/optional annotations. - Typed schemas on command structs —
@schemafields now reference type module schemas (e.g.Bibbidi.Types.BrowsingContext.schema()) instead ofZoi.any(), providing real validation and introspection for command fields. - Event structs — BiDi events are parsed into typed structs (one per event method). Subscribers receive
{:bibbidi_event, method, %EventStruct{}}instead of raw maps. - Telemetry correlation — command start/stop events include
:meta, event received includes:context/:navigation/:requestwhen present :connection_modoption — all generated facade functions acceptconnection_mod: MyModfor clean Mox-based testingBibbidi.Keys— maps human-friendly key names to BiDi Unicode codepoints for keyboard actions
Breaking
- Event subscribers receive structs instead of raw maps
- All facade functions accept
opts \\ [] - Command structs have a
:metafield (defaults tonil)
See CHANGELOG.md for full details.
v0.2.0
Features
- Encodable protocol —
Bibbidi.Encodablewithmethod/1andparams/1for 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, andresult_schema/0for runtime validation, introspection, and auto-generated documentation - Typed facade specs — facade functions use real CDDL-derived typespecs (e.g.
String.t()) instead ofterm(), andCommandName.opts()/CommandName.result()instead ofkeyword()/map() - Opts validation — facade functions validate keyword options via
Zoi.parse!/2before constructing command structs Connection.execute/2,3— acceptsEncodablestructs directly; existing function-based API is fully backwards-compatible- Telemetry —
[:bibbidi, :command, :start|:stop|:exception]events onConnection.execute/2and[: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 Runnermix 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/4is now a documented low-level escape hatch — useConnection.execute/2for normal usageCommands.Session.end_session/1renamed toCommands.Session.session_end/1—Bibbidi.Session.end_session/1is unchangedCommands.Session.unsubscribe/3changed toCommands.Session.unsubscribe/2—eventsmoved into keyword opts.Bibbidi.Session.unsubscribe/3is unchangedScript.evaluate/4→Script.evaluate/5—await_promiseis now a required positional argScript.call_function/4→Script.call_function/5—await_promiseis now a required positional arg, inserted beforetargetBibbidi.Transportbehaviour — added requiredsend_pong/1callback- 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/1andZoi.Struct.struct_fields/1
Fixed
Session.Unsubscribestruct now correctly includeseventsandsubscriptionsfields from the CDDL choice typeBibbidi.Session.unsubscribe/3no longer passessubscriptions: nilwhen the option is not provided
📦 Hex package · 📖 HexDocs
v0.1.0
Initial release of Bibbidi — a low-level Elixir implementation of the W3C WebDriver BiDi Protocol.