• sus@programming.devOP
    link
    fedilink
    arrow-up
    85
    ·
    edit-2
    3 months ago

    is-number is a one-line function. (though it’s debatable if a function that complex should be compressed to one line)

    You may have heard of a similar if more extreme “microdependency” called is-even. When you use an NPM package, you also need all the dependencies of that package, and the dependencies of those dependencies recursively. Each package has some overhead, eventually leading to this moment in time.

    • sparkle@lemm.ee
      link
      fedilink
      Cymraeg
      arrow-up
      12
      arrow-down
      1
      ·
      edit-2
      3 months ago

      Web bloat in a nutshell and why we need to switch to things like Web Assembly more than ever. It’s not WASM, but I used Laminar which is a Scala.js library, and it’s the absolute pinnacle of (frontend) web development. Scala in general is just really great for idiomatic web code, its flexibility is unbeatable.

      Another amazing alternative would be anything Rust. In fact I’ve used that much more than Scala for web. I’ve mainly used Leptos for full-stack and and Actix for backend, but I’ve seen Dioxus and Axum in good use and they both seem really great too.

      Apparently Lemmy uses Leptos for its UI so… that’s a +1.

      • Auzy@beehaw.org
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        I feel like this is completely avoidable bloat.

        You could quite easily create this bloat in any language