All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.0.1 - 2026-06-18
Added
RpcElixir.Context— request-scoped struct (conn, socket, assigns, private) threaded through middleware and into handlers.RpcElixir.Resolution— wraps a handler call with its context, arguments, result, and error fields.RpcElixir.Types— internal type representation and theinternal_spec()type, plusCustomTypebehaviour for user-defined type mappings.RpcElixir.Types.FromSpec— recommended backend; reads classic@specdeclarations from BEAM debug info viaCode.Typespecand translates them to the internal type map. No compile-time macro required.RpcElixir.Types.FromInferred— experimental backend; reads set-theoretic inferred signatures from theExCkBEAM chunk (Elixir 1.19+, private API, expect breakage on upgrade).RpcElixir.Router— procedure registration with compile-time@specvalidation in__before_compile__, plus thewire_aliasesoption for router-wide wire type substitution (e.g.{DateTime, RpcElixir.UnixMillis}).RpcElixir.Handler—use RpcElixir.Handlercaptures@specASTs into a__rpc_specs__/0accessor so handlers and router can share a Mix project.RpcElixir.Plug— HTTP transport forPOST /rpc/*: JSON decode, dispatch, and response rendering with cookie/header/session draining.RpcElixir.Middleware(+RpcElixir.Middleware.Assign) — request-scoped middleware framework threaded throughContext/Resolution.RpcElixir.Dispatcher— pipeline that performs lookup → input validation → handler invocation → output validation → serialization.RpcElixir.RpcError— structured error struct with:code,:message, and:detailsfields; the dispatcher promotes typed handler errors and codegen maps them toRpcError<Code, Details>in TypeScript.RpcElixir.call/4— in-process convenience caller for tests and server-to-server invocations.- TypeScript codegen — the
mix rpc.gen.tstask and the:elixir_ts_rpccompiler emit a fully typed client from a router; a devWatcherregenerates on change. - Branded wire types —
RpcElixir.CustomType'sts_type/0callback for branded string and number wires, andRpcElixir.UnixMillis(aDateTime↔ epoch-millisCustomTypedogfooding the public hatch). - Built-in JSON via Elixir 1.18+'s
JSONmodule (no:jasondependency). Requires Elixir~> 1.19. - Deterministic codegen output — structs, brands, and middleware error codes are emitted in sorted order so regenerated clients produce byte-stable diffs.
Notes
RpcError.detailsvalues must be JSON-native (strings, numbers, booleans, nil, lists, maps). The built-inJSONdoes not auto-encodeDate/DateTime/NaiveDateTime/Time/Decimal; pre-stringify any such values before placing them indetails.