BartOtten
Seeking your thoughts on Routex 1.2 pre-releases - localize Phoenix with minimal config
This thread once discussed Routex in it’s early form. It has been repurposed to gather feedback and discusses pre-releases.
Currently: pre 1.2.0
Target: localization with auto-detection of already used libs (Cldr, Gettext, Fluent), simplified setup, support for runtime dispatching and auto-plugs&hooks.
Official releases are announced at another thread: Routex - build powerful Phoenix routes: localize, customize, and innovate
Github: GitHub - BartOtten/routex: Build powerful Phoenix routes: localize, customize, and innovate · GitHub
Main branch documentation: Overview — Routex v1.3.1
Most Liked
BartOtten
After a lot of refining and polishing, the rough edges are now a thing of the past. I’m thrilled to officially release Routex 1.0.0! ![]()
This marks a major milestone for Routex, solidifying its stability and readiness for production use. It has been quite a journey, shaped by valuable feedback and real-world use cases.
As the decision-making process comes to a close, I’ve also created a fresh thread in the Libs section to continue the conversation:
A huge thank you to everyone who provided feedback—it has played a crucial role in shaping both the design and documentation. Your insights and contributions have made Routex stronger, and I truly appreciate the support.
kip
@BartOtten well since Phoenix 1.7 is now out I have to get off my backside and finish up ex_cldr_routes to include localised VerifiedRoutes.
So I’m in for some collaboration as you proposed - and see if we can take your new library and integrate it.
BartOtten
A long time has passed but it was worth it! To celebrate a nice set of improvements, I released Routex 0.3.0-alpha.2.
As Routex was very much alpha, I took the liberty to break a few things for the better. If you used Routex already, check the Changelog where the breaking changes are listed.
Call for help!
I would love to collaborate on this lib! See some comments, PR’s or extensions from community members. The quality of this lib will benefit from multiple eyes. Feel free to contact me by personal message or other means.
Highlights
new! the process dictionary can be used to determine route branch
Routex solely used pattern matching on URL’s to determine which route branch (former scope) to use. Now the process dict key :rtx_branch -when set- overrides the URL matching.
new! extension Route interpolation
A route can be defined with route attribute interpolation. Any route attribute can be used!
live "/#{region}/products/#{language}/:id", ProductLive.Index, :index
new! module Routex.Matchable.
Uniform, better, faster, easier to use and it Just Works™. The functions in this module allow developers unexperienced with Macro’s and/or AST to create simple helper functions, while more experienced AST developers will be happy with the abstractions it provides as.
Matchables are an essential part of Routex. They are used to match run time routes with compile time routes.
This module provides functions to create Matchables, convert them to match pattern AST as well as function heads AST and to check if the routing values of two Matchable records match.
new! Module Routex.Branching
Provides a set of functions to build branched variants of macro’s. It’s interface is still a bit rough but it’s usable enough to build a new version of extension Verified Routes with it.
The renewed Verified Routes extension.
Using Routex.Branching it now also creates branching variants of url/{1,2,3} and path/{2,3} with, of course, configurable names. When the names of Phoenix are used an improved warning is displayed during route compilation.
improved: added the attribute ‘match?’ to the results returned by ‘alternatives/1’
The value is determined by a pattern match, so performance wise we’re good. It does make code clean.
<.link
:for={alternative <- Routes.alternatives(@url)}
rel="alternate"
hreflang={alternative.attrs.language}
patch={alternative.slug}
>
<.button class={ (alternative.match? && "bg-[#FD4F00]") || "" }>
<%= alternative.attrs.name %>
</.button>
</.link>
Example app
Updated to use the latest version.
Example App
Github Example App
Popular in RFCs
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance











