• fxdave@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    7
    ·
    10 days ago

    As a web developer, I see js as a quality improvement. No page reloads, nice smooth ui. Luckily, PHP times has ended, but even in the PHP era disabling jQuery could cause problems.

    We could generate static html pages It just adds complexity.

    Personally I use only client-side rendering, and I think, that’s the best from dev perspective. Easy setup, no magic, nice ui. And that results in blank page when you disable js.

    If your motivation is to stop tracking.

    • replace all foreign domain sources to file uris. e.g.: load google fonts from local cache.
    • disable all foreign script files unless it’s valid like js packages from public CDNs, which case load them from local cache.

    If your motivation is to see old html pages, with minimal style, well it’s impossible to do them reliably. If you are worried about closed-source js. You shouldn’t be. It’s an isolated environment. if something is possible for js and you want to limit its capability, contribute to browsers. That’s the clear path.

    I can be convinced. What’s your motivation?

    • unwarlikeExtortion@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      ·
      10 days ago

      As a web dev, and primarily user, I like my phone having some juice left in it.

      The largest battery hog on my phone is the browser. I can’t help wonder why.

      I’d much rather wait a second or two rather than have my phone initialize some js framework 50 times per day.

      Dynamic HTML can be done - and is - server-side. Of course, not using a framework is harder, and all the current ones are client-side.

      Saying making unbloated pages is impossible to do right just makes it seem like you’re ill informed.

      On that note - “Closed-source” JS doesn’t really exist (at least client-side) - all JS is source-availiable in-browser - some may obfuscate, but it isn’t a privacy concern.

      The problem is that my phone does something it doesn’t have to.

      Having my phone fetch potentially 50 MB (usually 5-15) for each new website is a battery hog. And on a slow connection - to quote your words, “great UX”.

      The alternative is a few KB for the HTML, CSS and a small amount of tailor-made JS.

      A few KB’s which load a hundered times faster, don’t waste exorbitant amounts of computing power - while in essence losing nothing over your alternative.

      “Old pages with minima style” is a non-sequitur. Need I remind you, CSS is a thing. In fact, it may be more reliable than JS, since it isn’t turing-complete, it’s much simpler for browser interpreters to not fuck it up. Also, not nearly the vulnerability vector JS is.

      And your message for me and people like me, wanting websites not to outsource their power-hogging frameworks to my poor phone?

      Go build your own browser.

      What a joke.

      • fxdave@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        10 days ago

        Who said making unbloated pages impossible? Your comment would be more serious without your emotions.

        Source code is the source code which gets transformed to some target code. An obfuscated code is not source code.

        A reminder, in the past, large pages downloaded all stuff at once. In contrast, with dynamic imports the first load is much much faster. And that matters most. And any changes in dynamic content would just require the dynamic data to be downloaded. My phone lasts at least 2 days with one charge (avg usage), but I charge it every night, that’s not an issue.

      • A_norny_mousse@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 days ago

        Fuck yeah!

        Bookmarked for future use. CSS has developed a lot since I started getting aquainted with it.

        I didn’t read it completely, is browser coverage addressed in the article?

      • fxdave@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 days ago

        It suggests using minimal js, I use react the same way, whatever I can do with css, I do it with css. But I am not going to footgun myself. I start the app with react because at some point I will need react.

        • A_norny_mousse@feddit.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          10 days ago

          The only non-heated comment.

          You mean people replying to you? I wouldn’t call those heated, rather derisive. Just like your own original comment. You come across as presumptuous and pretending to be more knowledgeable than you really are. People react.

    • TrickDacy@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      10 days ago

      even in the PHP era disabling jQuery could cause problems.

      WTF. Do you think jQuery is what JavaScript used to be called or something? Pretty much everything you wrote is insane, and I specifically think that because I’ve been building webpages for 25 years. You sure never heard of progressive enhancement.

      • fxdave@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 days ago

        It seems you misunderstood me.

        There were horrible tricks and hacks that were addig not only ux improvements but useful content. We used jquery for many of those things. That’s why I wrote it, and for the legacy vibe.

        Disabling js would have broken that site as well, reinforcing my point that it was never a reliable solution to disable js.

    • A_norny_mousse@feddit.org
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      10 days ago

      If your motivation is to see old html pages, with minimal style

      Huh? i just want to see a web page. Usually a news article, i.e. text with few styling elements. In other words, HTML.
      For most use cases JS is not required.

      well it’s impossible to do them reliably

      Huh again? Why?

      If you are worried about closed-source js.

      Isn’t it always open, i.e. one can read the script the browser loads if one is so inclined? No, that’s not the point at all. JS increases the likelihood of data mining, by ordes of magnitude. And most addons that block js also block 3rd party requests generally.

      Use as much js as you like (most third party stuff is not really up to the web dev anyhow), but the page must always fail gracefully for those who do not like it, or browse the web in some non-standard way. An empty page is not an option.

      Please also read some of the other (top level) comments here.

      • fxdave@lemmy.ml
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        2
        ·
        10 days ago

        You were completely fine with slow page reloads blinding you when the theme was dark. I’m speaking to those who appreciate modern tech.

        But anyways, unfortunately javascript obfuscation is a common thing.

        • A_norny_mousse@feddit.org
          link
          fedilink
          English
          arrow-up
          1
          ·
          10 days ago

          Obfuscation, OK.

          Look, I’m willing to have a conversation with you, but you need to address my points first, that is if you want one too.

          • fxdave@lemmy.ml
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            1
            ·
            10 days ago

            I can’t take it seriously because of the noise in your text like “Huh?”. If you like to have a conversation, please be more open next time.

            Source code is the code before some kind of transpilation. Obfuscated code is not source code.

            I get it, you just need the content. But why would you reload the page when you’re just about to get the next news in the page. Isn’t it better to just update that part?

            • A_norny_mousse@feddit.org
              link
              fedilink
              English
              arrow-up
              0
              ·
              edit-2
              10 days ago

              Why is it “impossible to do them reliably” - without js presumably?

              why would you reload the page when you’re just about to get the next news in the page. Isn’t it better to just update that part?

              Sounds like you’re thinking about web apps, when most people here think about web pages.

              • fxdave@lemmy.ml
                link
                fedilink
                English
                arrow-up
                1
                ·
                9 days ago

                Why is it “impossible to do them reliably” - without js presumably?

                What I meant is that you cannot turn any existing webpages to a basic page with some simple tricks like disabling js. That would be a never-ending fight.

    • drosophila@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 days ago

      If your motivation is to see old html pages, with minimal style, well it’s impossible to do them reliably.

      Not only should your site be legible without JS, it should be legible without CSS, and infact without rendering the effects of the HTML tags (plain text after striping the tags).

      At one point in time this was the standard, that each layer was an enhancement on top of the one below it. Its seems that web devs now cannot even imagine writing a news article or a blog post like, something that has the entirety of its content contained within its text. A plain .txt file renders “reliably” on anything. You are the one adding extra complexity in there and then complaining that you’re forced to add even more to deal with the consequences of your actions.

      • fxdave@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 days ago

        What I meant is that you cannot turn any existing webpages to a basic page with some simple tricks like disabling js. That would be a never-ending fight.

        You are the one adding extra complexity

        I’m not the one defining the business requirement. I could build a site with true progressive enhancement. It’s just extra work, because the requirement is a modern page with actions, modals, notifications, etc.

        There are two ways I can fulfill this. SSR with scripts that feel like hacks. Or CSR. I choose CSR, but then progressive enhancement is now an extra work.