• dan@upvote.au
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    5 months ago

    Anyone that builds a SPA and breaks opening in new tab or history caching and back/forward nav isn’t a good frontend developer (or lacks experience, which is something that’s fixable!). These have been solved problems for a long time.

    • Ephera@lemmy.mlOP
      link
      fedilink
      arrow-up
      3
      ·
      5 months ago

      I mean, for sure, and this meme isn’t trying to say that all SPAs are bad. But defaults matter, even for experts.

      This meme was inspired after I had to use an SPA, which among those points in the meme, also broke using Alt+Left to navigate back. The normal back-button worked (even if it then had to load for ten seconds to re-display static content).

      Which is just a typical example to me. You don’t even need much expertise to figure out why Alt+Left is broken. But you have to think of testing Alt+Left, because it’s broken by default.

      • Trarmp@feddit.nl
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        I maintain a couple of Wordpress installations for clients, where new link targets are the same page, as you’d expect.

        They still, somehow, manually check “link opens in new tab”. I don’t know why some of these boomers are allowed to use computers, I swear.

        • toastal@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 months ago

          If you manage the WordPress installation, can’t you disable the ability or create/install a plugin that removes that ability? This hurts usability.

          • Trarmp@feddit.nl
            link
            fedilink
            arrow-up
            2
            ·
            5 months ago

            I could, good point. I do disable plugins for clients so they can’t beat up their own website too much.

            Still, there are legitimate uses for opening a site in a new tab; e.g. when it’s an external website. I don’t think I should automate that, since there’s a granularity in there.

            • toastal@lemmy.ml
              link
              fedilink
              arrow-up
              1
              arrow-down
              2
              ·
              edit-2
              5 months ago

              legitimate uses for opening a site in a new tab; e.g. when it’s an external website

              This is not a legitimate use—this breaks the default user agent behavior & completely removes the autonomy of opening in the current window (there are tons of ways to open in a new tab/window). Consider rechecking the article linked higher up the thread tree.

    • TherouxSonfeir@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      I’m guessing they aren’t using Vue, React, or similar, and they’re rolling their own for some reason.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        1
        ·
        5 months ago

        React doesn’t handle any of this stuff out-of-the-box; it’s just a UI library.

        • unalivejoy@lemm.ee
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          5 months ago

          Neither does vue. You need vue-router, which is required anyway to make an spa with multiple pages.

          The only thing that breaks is any component state isn’t saved. But this can be fixed by rendering <RouterView> with <KeepAlive>. How to do this is mentioned in the documentation.

          I assume it’s similar with react and react-router-dom.