BartOtten

BartOtten

Routex 1.3.2 fixes warnings when using Elixir 1.20+

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?

Trending in News & Updates Top

bartblast
After building Hologram and sharing updates across various places, I’ve realized there’s a lot happening that doesn’t always make it to t...
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
kip
I’m a bit excited to announce that Localize and friends are now at release 1.0. Even though it’s a 1.0 release, it stands on 8 years of w...
New
nseaSeb
Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex. What’s new: synonyms You can now declare a synonym dictionary per lang...
New
polvalente
We have released v0.13 of nx, exla and torchx, along with a recently released emlx v0.4. Nx This is where the bulk of the updates happen...
New
mudasobwa
After years of struggling I made StreamData dependency optional. Finitomata.ExUnit got testing primitives for Persistence. Full back co...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
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
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement