Have a meeting to catch. So short notice: Verified Routes can be tested by the brave ones! I advice to clone the branch and try with a local path in mix.ex.
By default it uses ~l for localized verified routes, this can be set in the config. For example sigil: "q".
When setting sigil: "p". You have to set sigil_original: so the ‘former ~p’ is aliased. An info message will be printed at compile time to remind you and other developers about what sigil does what.
Phoenix 1.7 includes a new Phoenix.VerifiedRoutes feature which provides ~p for route generation with compile-time verification.
This release adds support for Localized Verified Routes using sigil ~l. The sigil can be customized by setting the sigil_localized option in the configuration.
Overriding sigil ~p
The default sigil ~p used by Phoenix.VerifiedRoutes can be overridden by setting sigil_localized: "~p". When doing so, the original sigil is by default renamed to ~o. This can be customized by setting the sigil_original option.
Example
For an example of how to implement Phoenix Localized Routes using the new Verified Routes, have a look at the commits of the example app (branch bo/1.7).
Routex has almost feature parity with Phoenix Localized Routes already, only one or two extensions yet to be written. Minor modifications might be needed to the backend module / configuration but it’s almost a drop-in replacement.
Routex` Assigns extension supports custom namespaces, so I chose @loc for the Example app. The Example app is actually just the Example App from Localized Route with a few tiny modifications; mostly ‘naming’ things which should be migratable with a search-replace.
I would like to gather feedback on the idea before any release! So please let me know what your routing needs are so I can see if/how that would fit in the Routex ecosystem; being an extension or part of the framework itself.
Today Phoenix Localized Routes is officially deprecated…
… and it’s GIT repo has been archived. But that is good news as it means the first stable release of it’s successor, Routex, is near!
PLR did pave the way for some routing libs but that was possibly it’s only award. As it was the first of it’s kind the design left much to be desired. It’s successor, Routex, is in every aspect a better lib.
better design
better code
better documentation
better performance
better future
Users of PLR will see a few similarities so the migration should be quite straight forward. If PLR is working for you, there is no need to replace it as the Hex package will remain available.