DEV Community

Discussion on: Web Component Solutions: A Comparison

Collapse
 
dannyengelman profile image
Danny Engelman

Your native version is bloated and full of oldskool ES5 patterns, can be done shorter, smaller, faster see: webcomponents.dev/edit/tcbsq3X9MS2...

Collapse
 
thawkin3 profile image
Tyler Hawkins

For sure, the example here is using ES5 syntax, so no default parameter arguments or arrow functions like you have. I also saw you chose not to use the constructor, which is a fine choice too. The example I included was just taken directly from the example that was included in the webcomponent.dev blog post I've referenced throughout.

I wouldn't call that "bloat" though. If we're just talking about number of lines, having the CSS and HTML scrunched together on one line like you have it isn't very readable, so I wouldn't exactly chalk that up as an improvement.