BartOtten

BartOtten

Routex 1.3.2 has been released. It’s main focus was getting rid of warnings in Elixir 1.20 and completing a long standing todo to overhaul the macro branching module.

Bug Fixes:

  • core: matchable type warning in Elixir 1.20+ (#123) by @Rubas (tnq!)
  • core: unneeded require warnings in Elixir 1.20+

Soft Deprecation:

refactor(core): Routex.Branching overhaul

This change is (only) significant for extension developers. Parameter were
reordered and some option have been renamed (the old names are soft deprecated).
Please migrate your extensions when seeing deprecation messages.

IMPROVED:

  • Simplified transformer option format for better ergonomics
  • Comprehensive documentation with additional real-world examples
  • Clearer naming conventions across the API
  • Better type specifications and parameter descriptions
  • Extended tests

SOFT DEPRECATIONS:

  • Transformer return value :skip is deprecated in favor of :noop for clarity

  • New parameters order for improved cognitive flow (old order soft deprecated)

  • Options have been renamed for clarity:

    • :as → :name_branched
    • :orig → :name_passthrough
    • :arg_pos → :param_position

MIGRATION GUIDE:

  • Rename options (see above):
    Routex.Branching.branch_macro(… , param_position: fn arity → arity - 1 end)

  • Replace :skip with :noop in transformer functions:

    def my_transformer(pattern, arg) do
      if should_skip?(pattern), do: :noop, else: arg
    end
    
  • Replace MFA transformer options with the new format, the value of extra arguments should
    be put in the transformer functions themselves:

old:
*_transformer: {__MODULE__.Transformers, :transform_arg, [:foo]}

new:
*_transformer: &__MODULE__.Transformers.transform_clause/2

def my_transformer(pattern, arg) do
  arg <> to_string(:foo)
end

And an image for the imagination.

Where Next? Top

Trending in News & Updates Top

sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
bartblast
I’ll be using this thread to share Hologram patch release announcements. Minor releases will continue to get dedicated threads with blog ...
New
sorenone
This release unifies configuration for queues, repos, and services, swaps opaque timing integers for readable durations, and backports pe...
New
pcharbon
:heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::hea...
New
jvoegele
Bond brings Design by Contract to Elixir: preconditions, postconditions and invariants as executable specifications, checked at runtime a...
New
webofbits
Aludel 0.7.0 is released :tada: Since 0.5.0, Aludel has grown into a much more complete LLM evaluation toolkit for Elixir and Phoenix app...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews