3 ms·
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 drivingmenuts 3y ago
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?
- ceving 3y agoI had a snippet in my HTML for this. But the snippet was rejected by a content security policy.
- tomcam 3y agoCould it be that this serves another purpose, perhaps showing something close to the minimum code that's required to create a web component?
- eternityforest 3y agoSeems like it pretty much is a tiny snippet of JavaScript, it's just all professional and standardized and best-practices-y
- moritzwarhier 3y agoAlso, as a JS developer, even if you want to auto-update the end year to the current one, why would you do that on the client? To make the layout shift? Or to display (c) 2024-2038 on clients with wrong date settings? If it's statically generated, add the year at build time. If it's server-generated and dynamic, don't do it in JS I guess? I mean, why? It has only downsides.