Change in a live view template causes 42 files to be recompiled

Thank you! Seems like I did a really bad job at searching for similar issues since I missed quite a few relevant articles.


I’ll make sure to read them tomorrow, but for now, just based on your tl;dr:

The main cause for my particular problem with liveviews was sidebar and navbar components that were defined in layout view (templates/layout/...) and then used in many other views which caused cyclical dependency across almost all live views (layoutview (live.html.leex) -> some live view -> layoutview (sidebar or navbar)) so a change in any liveview caused recompilation of the layoutview which then caused the recompilation of all the other live views. The fix was to move these components (sidebar, navbar) to their own views (or use inline/collocated templates) and then render them in each custom live view layout defined in separate view modules. Not ideal and quite repetitive, but seems to work for now or until I find a way to make render_layout/4 work with live components..

1 Like