this post was submitted on 21 Jun 2024
57 points (96.7% liked)

Programming

17540 readers
77 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 !webdev@programming.dev



founded 2 years ago
MODERATORS
 

Too good NOT to share.

My brothers and sisters in Christ I want you to know that I care about your souls enough to share these truths with you:

  • You don’t need JavaScript to make a web page.
  • You don’t need JavaScript to write styles.
  • You don’t need JavaScript to make an animation.
  • You don’t need JavaScript just to show content.
you are viewing a single comment's thread
view the rest of the comments
[–] maegul@lemmy.ml 3 points 5 months ago (1 children)

Yea, I'm unclear on how you can take web components and still have widespread browser support (not knowing enough about their ins and outs).

Plain template elements are widely supported and have been for ~10 years (which ideologically matters to me along the same lines as the top post's article) ... perhaps a little bit of hacking together can get you close with just that?

[–] DmMacniel@feddit.de 3 points 5 months ago (1 children)

Every browser released since 2020 supports this (custom elements that is), so I don't see an issue with browser support.

You mean the Html template Element? I've never really got that to work, but I also never seriously tried.

[–] maegul@lemmy.ml 2 points 5 months ago

Every browser released since 2020 supports this

It's a little paranoid of me, but I like the idea that a basic web app I make can be thrown onto any old out of date machine, where ~2015 or younger seems about right for me ATM.

You mean the Html template Element? I’ve never really got that to work, but I also never seriously tried.

Yea. From memory, it's just an unrendered chunk of HTML that you can select and clone with a bit of JS. I always figured there'd be a pattern that isn't too much of a cludge and gets you some useful amount of the way to components for basic "vanilla-js" pages, just never gave it a shot either.