cachex icon indicating copy to clipboard operation
cachex copied to clipboard

Simplify and naturalize API signatures and return types (5.x)

Open whitfin opened this issue 2 months ago • 1 comments

This will eventually fix #382, but is heavily WIP.

The idea is to simplify the Cachex API to strip out all unnecessary tagging (i.e. {:ok, _}) and align more with Elixir's stdlib conventions with naming. All of the discussion is in the linked thread, but in particular here are some of the changes:

  • Replace invalid cache calls with an ArgumentError
  • Strip out tagging from all infallible calls
  • Drop ! variants of infallible calls
  • Ensure names are generally consistent with Elixir conventions
  • Clean up dialyzer typing where we can

This will be a large amount of changes, but I'll try to break things up so that it's a) easier to track and b) keep it tested throughout. This will be merged into main when ready, but definitely triggers the 5.x timeline and will not be released until 5.x is "done".

There will be many breaking changes in this migration, but I'll try to keep it minimal. Several breaking changes are just "better", though.

whitfin avatar Oct 28 '25 15:10 whitfin

Progress is good, but there are a few concerns that will span into other issues (see https://github.com/whitfin/cachex/issues/382#issuecomment-3468570692 for context).

whitfin avatar Oct 30 '25 15:10 whitfin