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?

Popular in News & Updates Top

lawik
It is my pleasure to announce the official release of the new generation of NervesHub with the v2.0.0 release. Containers are tagged. :p...
New
jjcarstens
Do you like Hacktoberfest? Also enjoy working with Nerves and want to contribute? Fantastic! :tada: :beers: Here are some potential sta...
New
sorenone
The title doesn’t relay the depth of this announcement, but it is short, balanced, and looked good to us. From open sourcing multiple pac...
New
zachdaniel
Hey folks! We’ve just released the beta 0.1.0 version of ash_sqlite. Take a look at the guide here: https://hexdocs.pm/ash_sqlite/get-sta...
New
zachdaniel
The new Ash Framework site and installer are live. Please try it out and let me know what you think!
New
fhunleth
We’ve released Nerves v1.3.0 with support for Elixir 1.7 and Distillery 2.0! We encountered a few bumps over the past week, but it’s look...
New
fhunleth
Nerves systems provide the operating system, libraries and other tools for building firmware for specific hardware. The Nerves Core Team ...
New
hugobarauna
Discover Livebook 0.9’s new security features, including Hubs for centralized secret management, notebook stamping, and a sneak peek into...
New
mobileoverlord
Action Advised: NervesHub Sunset In 2018, NervesHub was launched to deliver first-class support for hardware deployments directly from th...
New
fhunleth
I wanted to let everyone know that the Erlang Ecosystem Foundation (EEF) has a working group dedicated to embedded systems and IoT. We ha...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement