Skip to content

Recompilation speedup: Pleroma.Web.get_api_routes/0 --> Pleroma.Web.Router.get_api_routes/0

Alex Gleason requested to merge cycles-router-api-routes into develop

#2651 (closed)

This MR moves the function get_api_routes/0 out of Web and into Router.

This change is significant AF and I'm not even gonna share a screenshot, just click the link:

It removes a cycle and cuts down the size of nearly ALL other cycles.

The problem is that making Web depend on Router causes a lot of cycles, since most of the stuff in Router depends back on Web (controllers, plugs, etc) at compile time. It's important we keep Web clean of any deps as it will certainly create cycles otherwise.

I believe putting this function in Router is far more canonical than putting it in Web, so I consider this a code quality improvement in addition to improving recompilation performance.

Merge request reports