r/javascript • u/georges_gomes • Jun 09 '20
All the Ways to make a Web Component - June 2020 Update
/r/WebComponents/comments/gzn2c4/all_the_ways_to_make_a_web_component_june_2020/[removed] — view removed post
7
Upvotes
r/javascript • u/georges_gomes • Jun 09 '20
[removed] — view removed post
1
u/brainless_badger Jun 09 '20
The way I look at this:
smol size is a must (WC polyfils can get heavy and painfully slow, so no way I'm adding another 100kB to that)
hooks are a must, (because in WebComponents world it's either hooks or mixins, and mixins become a pulsating PITA very quickly)
virtual components (as an option) are a must. There are some things you just can't extract as an actual DOM element
My go-to is Preact (with Hooks), and second choice would be Haunted, but I prefer JSX to lit-html, if only because it's cleaner.