Re:Implementing single-file web components
by woodrowbarlow on Monday March 23, 2020 @11:49AM
(#22665162)
but scoping everything to the component can be done just as easily with three separate files.
[ Parent
| on HN ]
Over which you have to navigate by opening, closing, switching tabs etc.
I frequently find myself overwhelmed with the sheer number of files such a convention generates.
But the strengths of the single-file approach reveal themselves when you have a lot of small components - it enables you to just glance at a file and immediately know what's going on.
Also it puts a psychological barier against large, bloated components.
Re:Implementing single-file web components
by woodrowbarlow on Monday March 23, 2020 @12:04PM
(#22665292)
> it puts a psychological barrier against large, bloated components
this is the most compelling argument for me... but i still find myself having to work with overly-large components written by others. and that's when i end up doing lots and lots of scrolling and losing my place.
i guess that's the difference. single-file components are superior iff you have good team rigor around component size.