Elektrine lite

← Feed

@pfmoore@mastodon.social

Post #309562

2026-01-02 21:21 UTC

I'm looking for some guidelines on how to write simple single-page webapps. No frameworks, node.js, or build steps, just HTML, CSS, Javascript. Until now, I've been dumping everything in one handwritten .html file. But it's getting unwieldy, and I don't know how best to structure things for maintainability, while still avoiding the "flavour of the month" web frameworks. Does anyone have any good pointers, before I start reinventing the wheel?

Replies (2)

  • @pradyunsg@mastodon.social 2026-01-02 22:02

    @pfmoore I end up putting the CSS and JS files next to html file, and pull the in via link and script.

    Open ##1528707

  • @FunkyBob@chaos.social 2026-01-03 00:17

    @pfmoore I figure there's no need to go any more complex than is helpful. Splitting your JS and CSS into separate files helps keep things orderly, and can benefit caching. If later it becomes useful to split your JS further, to make it easier to manage, do so; consider a sub directory - again, for your convenience, only. It's highly unlikely you'll scale to a point where splitting up files will make any significant performance difference, so make life easier on you, the maintainer.

    Open ##1528709