News for hackers. Stuff that matters.
Re:Implementing single-file web components by burlesona on Monday March 23, 2020 @12:29PM (#22665576)
Yes, and for a very mundane reason. When an application is long-lived there’s inevitably some bit rot where one layer (template, style, or JavaScript) gets removed for some reason, and one or more of the corresponding layers is accidentally left in the code. This is especially likely to be CSS.

With single file components it’s much easier to track the dependencies and rebuild / scrap chunks of code without leaving cruft around accidentally.

Re:Implementing single-file web components by hombre_fatal on Monday March 23, 2020 @02:53PM (#22667327)
In over 10 years I've never worked somewhere where anyone was trying to prune unused CSS, especially in the traditional approach where you just have large .css files that become append-only.

Not until I experienced component-level CSS did I see it happen since now it's relatively trivial to see unused CSS.

Re:Implementing single-file web components by woodrowbarlow on Monday March 23, 2020 @01:37PM (#22666470)
i would buy this argument, because i have seen this happen with WPF/XAML (person deletes the markup and code-behind, but accidentally leaves the viewmodel), except that in the webcomponents world i would imagine you'd have all three files living alone in a folder named after the component.
Re:Implementing single-file web components by Udik on Monday March 23, 2020 @12:57PM (#22665929)
How is that possible when templates, style and js live side by side in a folder dedicated to that component only?