Good question Nick.
Leon Revill
1

In my understanding, HTML5 templates and JavaScript template strings are quite different. The former is a way to create an invisible DOM node, which you can access later with JavaScript. The latter is a way to write arbitrary strings directly inside JavaScript and use interpolation to fill them with dynamic data. One could argue, that both features accomplish the same task, but HTML5 Templates by themselves don’t have any interpolation.

I don’t understand why people think that HTML imports are replaced by ES2016 modules. The former is a way to include HTML documents inside other HTML documents, the latter is a way to load pure JavaScript modules. In other words, with HTML imports you can load HTML, CSS, JS and other assets. JS modules are only for JavaScript and you need other tools to manage everything else (eg webpack).

I see many statements that HTML imports are useless, but no one explains how to replace them with JS modules. I agree, that both specs are conflicting right now and that is the reason why they are not final yet. At the same time I don’t agree that either of them is useless.

Like what you read? Give Tim Navrotskyy a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.