Closed bjornmeansbear closed 7 years ago
Regardless of template language it's always "better" to have a compile step. Almost all JS examples these days have a build step. Most of the time people babel is sufficient.
So I'd say keep your templates in unique files. Makes the option on have a build step easier. There are some tools for converting mustache files into plain javascript so you don't have to ship the mustache parser to the client. It's faster and takes less bandwidth doing it that way.
Unless the audience isn't going to do more advanced JS, then keep it inline for ease of use.
@webmasterkai you goof ball... Yeah, I was talking to some design students about this, who want to hopefully help flesh it out a little more for their peers that don't understand things, so we'll probably be keeping it inline, but this was going to be a question for them to answer 😛
So, answer is yes, we'll leave them in HTML for now as it is the simplest scenario for understanding.
Or, do we include another JS file for each template?