| ▲ | hnlmorg 2 days ago | |||||||||||||||||||||||||||||||
I'm not advocating this development approach, but I also think some of your reasons aren't particularly robust when scrutinized. > can't reuse a stylesheet, script or image on a different page (each has to have their own copy) Isn't the point of a single HTML file that you don't have different pages that would need to reuse those assets? > can't cache commonly used files You can still cache the HTML. > can't make granular changes to specific parts of the code Pretty sure text editors can edit text regardless of whether it's a single file or multiple files. > can't set a proper content security policy I'd have thought a single page HTML file could negate the need for a CSP since you no longer have any resources accessible via a URI that you need to limit access to. > you wouldn't want a single (extremely ugly) HTML file Ugliness a subjective. --- I think your first load point is the strongest one. But I'd also throw in "it's harder to develop a good single page HTML" You could probably mitigate some of that difficulty by having a build script (like static site compilers) but then you have to ask yourself if you're introducing more complexity than you're attempting to solve. | ||||||||||||||||||||||||||||||||
| ▲ | notpushkin 2 days ago | parent [-] | |||||||||||||||||||||||||||||||
If you need a build script, your app is probably too big to be a single .html already. > You can still cache the HTML. But then any time you update any part of the app, the user has to re-download the whole thing. It is also a problem with many traditional frontend builds, but if you carefully split it into chunks, you can update parts of the app while most of it stays cached. See e.g. Linear’s approach to vendor dependencies: https://performance.dev/how-is-linear-so-fast-a-technical-br... --- The strong point of single .html apps is, of course, that you can run them locally without setting up a web server or anything, and deploy anywhere you want by just uploading it. But it is a fairly niche thing IMO. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||