Writing a cool component library

Riot.js — Simple and elegant component-based UI library
Riot.js lets you build user interfaces with custom tags using simple and enjoyable syntax.
8 Replies
Jochem
Jochem2y ago
did you mean to post this in #resources or is there a question attached? @aolko
aolko
aolkoOP2y ago
actually yes, there is a question - how to write your own cool library like that, but very barebones (microlibrary)?
Jochem
Jochem2y ago
very broadly, they seem to be using a compiler to generate web components. The compiler is also open source so you can poke around. https://github.com/riot/compiler MDN has a bunch of resources on web components https://developer.mozilla.org/en-US/docs/Web/API/Web_Components
aolko
aolkoOP2y ago
you do see the screenshot right? that's what W3C does wrong the goal is not to be like W3C as for the compiler, we are talking barebones library, meaning no large moving parts
Jochem
Jochem2y ago
that's not about being like the W3C. That recommendation is primarily because the w3c might implement new tags in the future, and they guarantee they won't use any tags with dashes in them so if you want to be sure your site won't break in the future, you should include dashes in your element names "demands" is a bit of an overstatement though. If you want to validate using the w3c validator, sure... but browsers will just treat unknown tags as divs all day long
aolko
aolkoOP2y ago
what if i want my tags <with:namespaces>?
Jochem
Jochem2y ago
I'm not sure if colons are allowed characters in tag names in HTML
aolko
aolkoOP2y ago
(actually any available tag name is allowed, the rest is styling problem)
Want results from more Discord servers?
Add your server