Show HN: Tiniest Web Component

by cevingon 3/27/24, 3:23 PMwith 21 comments
by vwellingon 3/28/24, 10:19 AM

When claiming copyright, you should mention the date of first publication and if applicable, the last significant revision. Not the current date.

by jjiceon 3/28/24, 3:20 PM

Tangential, but what's the state of web components at the moment? As a backend engineer, they were very appealing early on since I didn't want to deal with adding an entire framework onto a simple project. How'd that work out? It seems like the big frameworks are still kind by a mile and they provide a much easier developer experience still. Am I wrong there?

by KTibowon 3/28/24, 4:33 AM

Is there a good reason to use a shadow root for this instead of just directly setting innerText

by dannyeon 3/28/24, 4:48 PM

There are some issues with this code: https://gist.github.com/ceving/6e65886e04563ed9e6e42cc5f8d3f...

by phillipseamoreon 3/27/24, 3:53 PM

Safari has support for "is" attribute now?

by drivingmenutson 3/27/24, 4:51 PM

Is it necessary to use a web component to do what you could do with a snippet of Javascript? What is the use case for this?

by tomcamon 3/28/24, 2:15 AM

Excellent example for someone trying to wrap their arms around web components.

by cranberryturkeyon 3/28/24, 2:24 AM

this code isn't what's rendered. there's something about `this.textContent - ${year}` but that's not what we're seeing in output.