News for hackers. Stuff that matters.
Re:Nazca – New GUI for the Web by bogwog on Wednesday November 03, 2021 @08:28AM (#29093669)
Having separate html/css/js files is a good thing, I don't why you'd want to combine them?
Re:Nazca – New GUI for the Web by mumblemumble on Wednesday November 03, 2021 @09:23AM (#29094223)
When Windows Presentation Foundation split layout, styling, and logic into three separate sets of files, it was a huge win for maintainability. I had my share of complaints about WPF, but it was never that. It was mostly that I wished the rules for how they interacted with each other were easier to understand.

I feel the same way about html/css/jss. It's not the fundamental triumvirate that bothers me. And I'm fine with their respective syntaxes. My problem is that the semantics of the whole system is an ever-growing Gordian knot of accidental complexity.

But that problem is very nearly unfixable, so I can't really blame anyone for tinkering with more superficial things instead.

Re:Nazca – New GUI for the Web by l30n4da5 on Wednesday November 03, 2021 @10:54AM (#29095525)
It isn't really the fact that it is all in one file that is the problem for maintainability, imo, it is that all (html, js. css) are incorporated together into a single unit, with no way of breaking it up.

Vue puts html, js, and css into the same file with their .vue files, and it works great, because they keep those things separate _within_ the file. Also, there is the ability to load each section from a separate file, as well, which works flawlessly.

Re:Nazca – New GUI for the Web by IshKebab on Wednesday November 03, 2021 @11:17AM (#29095883)
> and it works great

It works okay, except that it makes all tooling much much more complicated because you have to deal with multi-language files, and the template is HTML so you get frequent type errors (TSX catches those at compile time).

Re:Nazca – New GUI for the Web by l30n4da5 on Wednesday November 03, 2021 @02:16PM (#29098391)
> It works okay, except that it makes all tooling much much more complicated because you have to deal with multi-language files

So load those files as external, single-language files. Problem solved.

Re:Nazca – New GUI for the Web by IshKebab on Thursday November 04, 2021 @01:53PM (#29110396)
That would be extremely gross and wouldn't even work in some cases. E.g. a Javascript linter may rely on actual files in actual paths. And you can't do that for IDEs so you'll have to do a ton of extra work to get them to work with it.

Not worth it.

Re:Nazca – New GUI for the Web by mrweasel on Wednesday November 03, 2021 @08:44AM (#29093793)
That shipped has sailed long ago. I don't disagree, and I really don't want to work with any technology that mixes HTML and JavaScript, but that's not really how modern web frameworks view the world.
Re:Nazca – New GUI for the Web by fayten on Wednesday November 03, 2021 @08:53AM (#29093890)
I agree, in fact I wish there was one more layer that separated layout from styling. Keep padding, but tear out flex box, grid, margin, etc and have a VFL like language instead.

Too be fair flex box and grid are pretty good. I just wish I didn't have to sometimes skim through huge CSS or SASS files to make layout changes.

Re:Nazca – New GUI for the Web by djrockstar1 on Wednesday November 03, 2021 @08:58AM (#29093953)
Angular's flex-layout sort of achieves this? Where you can define the layout of the page within the template using flex attributes, but still have another file for css.
Re:Nazca – New GUI for the Web by Zababa on Wednesday November 03, 2021 @09:45AM (#29094460)
I'm not sure, I think the idea of scoping HTML/CSS/JS at the same level is good for development. At least when you think in terms of "components", it's easy to see why you would want content, styling and behaviour together. Keeping things local makes everything easier in my experience.

HTML also has that weird position where you have things like <video> or forms, which are not really content but entire components, but still lacks lots of things people expect from a component library.

Re:Nazca – New GUI for the Web by DemocracyFTW on Wednesday November 03, 2021 @09:09AM (#29094074)
Having them separate is not necessarily a good thing. Svelte for one collects all the HTML, JS and CSS that you need for a given component into a single file (that uses the original syntax for each language). You can still draw in code from external files, but otherwise your component is just 1 file to take care of. Components are largely isolated from each other so the `.foobar` class used in one component does not affect the `.foobar` used in another.
Re:Nazca – New GUI for the Web by lvncelot on Wednesday November 03, 2021 @09:15AM (#29094136)
Vue does the same thing with .vue files.
Re:Nazca – New GUI for the Web by chakkepolja on Thursday November 04, 2021 @05:18AM (#29104931)
It maybe just that I am a millennial and lack experience, but for me component based approach is much better than all 3 in separate file, for both maintainability and code reuse.
Re:Nazca – New GUI for the Web by jpfed on Wednesday November 03, 2021 @11:46AM (#29096281)
Nazca's include mechanism allows you to separate your code in whatever way you find appropriate.
Re:Nazca – New GUI for the Web by rkangel on Wednesday November 03, 2021 @09:08AM (#29094062)
Except that in a lot of modern frameworks that separation has gone away - look at React components where the markup and styles usually live together.
Re:Nazca – New GUI for the Web by l30n4da5 on Wednesday November 03, 2021 @10:54AM (#29095530)
really hate the direction React has gone with that.