I finally solved my problem 
Touching a view now recompiles only 1 file, and touching a controller recompiles 2 files (the controller and the endpoint) instead of 208 … (went from 30sec to 2sec)
What did I do?
- watched this video twice
- ran a gazillion times mix
xref graph --source lib/../my_controller.exandxref graph --sink lib/../router.ex - also ran
fswatch _build -r | cat | grep .beamto actually see what files are being recompiled - aliased
RouteHelpersinstead of importing them - removed any hard reference to
LayoutVieworRouterin any of my plugs. I had to workaround this problem by usingModule.concat["MyApp.Router.Helpers"]in my navigation plugs - had a weird dependency issue related to Coherence library when
coherence_routeswere inlined in my app main scope instead of its own dedicated scope - the last one still seems weird to me, but I also had to rewrite any
defdelegatecalls from views to other views into a classic function call
Hope it will help someone, and if you have any comment about my post, feel free!




















