Static pages are superior to SPAs.

  • 0
  • 1
    HTA files must be laughing
  • 1
    ... define "superior".

    what are your goals, considerations, metrics, and ideals included in that term?

    i personally get what SPAs are trying to do, and agree with the sentiment, but they are doing it using the wrong tools.

    SPAs should be proper native binary apps, streamed to you on first load, cached, and then just work as network apps. no fuckin js, no interpreters.

    internet is moving in the opposite direction relative to where it should be going.

    webassembly was a step in the right direction, but too little, too late, it seems.

    html is for documents. make apps in what was made for making apps.
  • 0
    I don't think I can go back to writing js and html separately & without reactivity. Vue has spoiled me.
  • 2
    Fuck static pages, why can't end users not just use cURL to access my JSON API.
  • 3

    He said static. No JS. Not necessarily CSS or HTML either.

    You can just use a TXT file, prepend a HTTP/1.0 200 OK header with a content length, and pipe it into netcat (| nc -l 80)
  • 1
    @bittersweet Of course static pages can include JS. Static doesn't mean "nothing moves on the screen."
  • 1
    @Fast-Nop You mean like use ncurses to draw frames in the terminal?

    How else would you animate the output of cURL?
  • 0
    @bittersweet I like the way you think!
  • 1
    @lungdart I once wrote an MVC backend framework in almost pure bash. It used systemd to let netcat act as a webserver, and awk as the basis of a HTML template parser. Even created an ORM which used a querybuilder DSL to parse CSV files and "hydrate" them into "models" and bind them to route parameters.

    It didn't perform as well as I had hoped.
  • 1
    @bittersweet sounds like a good vim plugin
  • 0
    @bittersweet I mean like in real world static pages where the markup uses the script tag to include a JS file. The JS can even generate HTML nodes on the fly via DOM manipulation, e.g. for more compicated widgets.

    You can even have dynamic content via APIs. That's called the JAM-Stack - JavaScript, APIs, and Markup.
  • 0
    @Fast-Nop But then React, Vue and Angular would also be static?

    I mean, a SPA is not much more than including JS, generating (virtual) DOM nodes and syncing those, and getting dynamic content from an API.

    When I hear "static pages" I pretty much think "works without asynchronous requests".
  • 0
    @bittersweet You can deliver everything as static files. The major point is not having a CMS behind, at least not online - a CMS at compile time is fine. Basically, that allows a lot except stuff where the whole point is dynamic content that is updated in real time, such as devRant.

    My own website is static, mostly because the content is static in nature. It does have some JavaScript for complex widgets where it makes sense, but that still counts as static because it's just static files.

    I've even gone as far as avoiding a PHP lookup in the footer for the copyright year. So at the end of the year, I change my footer template, re-compile, and upload the files.

    The benefit? I don't care about whatever vulnerability in whatever WP plugin is discovered. I see a lot of attacks on my WP installation, but there is none. Also, the Nginx reverse proxy makes shit really fast despite cheap shared hosting.
  • 1
    For me, a static web site only consists of a Webserver serving HTML and CSS files from the file system.

    There is no scripting - neither frontent, nor backend. There aren't even server-side includes.
    The site may have been generated and transfered to the server though.

    Wikipedia is less strict and allows client-side scripts:
  • 1
    @Oktokolo Wikipedia is correct in that because "static" refers to the server serving static files - regardless of what content because the server doesn't care. HTML, CSS, JS, images, videos, audio, ASCII text files, PDF, whatever.
Add Comment