These days the solution usually falls into 3 camps:
1) Write everything in JS like React.createElement or Mithril. No build setup but a pain to use.
2) JSX. Requires a build setup which might become complex as the project grows.
3) Templates. Probably the less elegant of all 3 but the most pragmatic and easy to use.
Someone attempted to solve this and created a new language called Imba. It's like a mutant Ruby with HTML that compiles to JS.
It has a lot of productivity benefits compared to previous attempts at solving the same problem, but goddammit it's ugly.