this post was submitted on 17 Apr 2025
11 points (92.3% liked)

Programming

19766 readers
81 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
 

I made something to try out for "funtional webcomponents" with vanillaJs. I'm working towards a UI framework for my personal projects. It's far from finished but i thought it might be an interesting concept to share.

top 5 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 1 week ago (1 children)

Isn't 'innerHTML' considered unsafe? Can someone with subject knowledge please explain.

[–] [email protected] 1 points 6 days ago (1 children)

MDN says you're right because innerHTML is un-escaped and you're probably trying to use textContent. Didn't know about this one, thanks.

[–] xoron 1 points 4 days ago

Interesting. I'll investigate this further. Thanks for pointing it out.

[–] [email protected] 1 points 1 week ago (1 children)

That's really cool. I always thought web components needed something more to be really useful. I work with vanilla web components at work all the time and they're not really that fun to work with

[–] xoron 1 points 1 week ago

thanks! ikr. i had the same exp which im sure imspired this approach.

the functional approach makes it easier for readability and debugging.