Re:Implementing single-file web components
by bigmanwalter on Monday March 23, 2020 @12:51PM
(#22665849)
I like the cut of your jib! I recently inherited a project with nested components and inheritance and all these insane levels of abstraction and it's impossible know what's going on anywhere. The crazy part is that all this abstraction is hiding incredibly simple HTML underneath it all, and the components are rarely used in more than one place.
Anytime I need to do some real work on this project, it's easier to just replace the call site of the component with the final HTML output, and move any required logic to the top level.
Turns out that across the multiple call sites, the final HTML output isn't really the same and this forgoes all the messy conditional logic and awkward data massaging that the original developer included.
Anytime I need to do some real work on this project, it's easier to just replace the call site of the component with the final HTML output, and move any required logic to the top level.
Turns out that across the multiple call sites, the final HTML output isn't really the same and this forgoes all the messy conditional logic and awkward data massaging that the original developer included.
As far as buttons go, the easiest is to just use
and everywhere. Look at that, turns out CSS is a component framework already ;)