I am (still) working on a formatter for HOLO sigil templates. As part of my development and testing, I have enabled formatting for .holo files and created an example.
I am wondering if this will ever make sense in Hologram-at-large. Would it be reasonable to elide the template/0 definition from, say, the user.ex component and have a user.holo template file in the same path transcluded at compilation?
I don’t actually have a deeply held opinion. I can see it appearing to be “spooky action at a distance” or “convenient to separate concerns” in neatly equal measures.
I generally agree with @jam that single-file components are superior - they keep everything cohesive, make refactoring simpler, and reduce the cognitive overhead of tracking which files belong together.
That said, both approaches already work in Hologram, and I’ve been asked about separate template files multiple times across different channels, so there’s clearly demand for that. I think Hologram can still be opinionated and advocate for single-file components as the recommended approach - we can clearly state that single-file components are the Hologram way of doing things - while not forcing everyone down that path. Some people have their own habits, their brains work in specific ways, or they’re coming from frameworks where separate templates feel natural.
There are cases where it’s better to let users discover the benefits of an approach when they’re ready, rather than forcing it on them from the start - though that’s not always possible or practical. If the formatter work makes separate templates more ergonomic for those who prefer them, I see that as a net positive even if it’s not the path I’d personally recommend - and from what I understand, there’s no substantial additional work to make that happen.