Skip to content

Switch to aliasing `Router.Helpers` instead of importing

Alex Gleason requested to merge alias-router-helpers into develop

In my research of speeding up recompilation (#2651 (closed)) the first thing most sources recommend is switching Phoenix router helpers to be an alias instead of an import.

The gains here are marginal, but I still felt it was worth doing because:

  1. It makes router helpers a runtime dependency instead of an export dependency.
  2. It makes the code a bit easier to understand. Instead of functions like o_auth_path() floating in space, Routes.o_auth_path() is more explicit.
  3. It rules this out as a source of recompilation slowness.
  4. It's the new default way Phoenix does it.

Merge request reports