5 ms·
You still need some sort of templating library. You can use Handlebars or Mustache, but if you are using TypeScript there is now something better: https://githu
by interlocutor 11y ago
You still need some sort of templating library. You can use Handlebars or Mustache, but if you are using TypeScript there is now something better: https://github.com/wisercoder/uibuilder https://github.com/wisercoder/uibuilder
UIBuilder is basically TypeScript's TSX file but without React's bloat. The whole UIBuilder is about 100 lines of code. The advantage over Mustache is compile-time error checking of expressions used in the template, and of course full Intellisense, Refactoring etc if you are using Visual Studio.
- tomc1985 11y agoYou can write your own "templating library" in about 20 lines of regular boring ol' JS
- interlocutor 11y agoWith compile-time error checking of expressions that insert dynamic content into the template? With support for intellisense and refactoring?