Been playing with simple web components recently for some codewithhugo.com pages Found it a bit painful to do templating (`.innerHTML` or `.appendChild` friendly options) Open sourced 2 utils that I couldn't find a lightweight existing package for (`lit-html` seems heavy handed in this case)
Post
codewithhugo.comCode with HugoNode.js and JavaScript Guides - Build your web platform with modern best-practices & tools
`html-esc`: A template literal tag which escapes interpolated values github.com/HugoDF/html-... `render-tmpl`: A `<template>` based HTML templating library ("directives" to make it easy to inject values and attributes into your template) github.com/HugoDF/rende...
github.comGitHub - HugoDF/render-tmpl: Use `<template>` as a rendering engine, < 100 lines of code.Use `<template>` as a rendering engine, < 100 lines of code. - HugoDF/render-tmpl
Both are ESM native, "no build" and "copy-paste into my project" friendly Examples with actual web components coming at some point. Note: I haven't tackled interactive forms, they don't have reactivity, they don't deal with event handlers
0 reposts0 likes