phlex: Avoid template naming conflict
Have you thought about renaming the template method to avoid conflicting with the HTML <template> tag? For example, render?
This would completely remove that gotcha/caveat, and also makes a little more sense from a naming POV.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (9 by maintainers)
Right, the compiler can completely remove this problem as long as we can solve it (slowly) without it. I’m just not confident enough that the compiler will be reliable enough to commit to it yet, but it’s looking good so far.
Some suggestions:
When you describe it like that, it makes sense, but as far as a public API is concerned, the
templatemethod is all that matters, and I see that as I am rendering the content of the method that is currently calledtemplate. So a verb makes sense.But hey, each to their own. You’ve already solved the template HTML tag conflict, so I’m happy 👏
thx
My only concern really is the gotcha concerning the need to use
template_tag. Gotchas are never a great DX.Maybe it’s because I know Vue a little, but because of Vue there’s kind of a precedent for using template as the markup generating block in single file components. Sure, it’s more correct in javascript land, but it still feels conceptually right to me. (Also, I think the conflict with the template element is pretty niche unless you use the template tag a lot, and when you write HTML with a Ruby DSL, I think adjustments are to be expected anyway.)
(My two cents as a regular user!)