‹ BackHN Continuity

Thread

Why don't more developers “use the platform”?

304 points · 321 comments · vinhnx

  1. jchw · · focus · HN ↗
    For one thing, I just genuinely think WebComponents are a badly designed API that is weird and hard to use (how many people are using WebComponents without at least Lit, if not something much bigger?), and React is a relatively well-designed library that isn't really that bloated. There's not really much of a point in trying to argue since this is inherently subjective and people with different values are going to irreconcilably disagree. But, if you don't respect that some people hold this position, we're not going to make any progress towards a consensus.

    On the note of <dialog>, I recently tried to use <dialog> in a (React) application, and it did work pretty well, but I also found that in Firefox it is only practically possible to do a fade-in animation, not a fade-out one. That isn't really a critical issue for me, it is just an animation after all, but I find it unfortunate. I also find <dialog> to be a weirdly shaped API too: I don't really hate it, but I don't love it either. It feels awkward.

    I find this implicit view that developers that, for example, prefer React over WebComponents are making a suboptimal choice to be rather condescending and not really in the spirit of trying to see things from the other side. Wouldn't you want to focus on the strongest arguments and not the weakest ones? Maybe you've literally never heard anyone complain about WebComponents or Shadow DOM, but if so, I find that surprising. Certainly here on HN, I've seen a fair bit of WebComponents hate.

    I do, FWIW, realize that I've particularly focused on WebComponents, which this article doesn't actually name directly. But, I assume we're not talking about ditching React to implement our own component framework on top of the traditional DOM APIs, because that's what React already does...

    1. spankalee · · focus · HN ↗
      What about the web components APIs are bad, and how could they be done differently given the reality of the existing platform?
      1. nananana9 · · focus · HN ↗
        The current state of the platform has even been a blocker to standards folk when they want to add a shiny new thing, thus the absurd bloat of the specs.

        For one, they can stop pretending that JS and the DOM are two completely separate entities, and lock the two working groups in a basement until they figure out a sane way to do reactivity, natively, that actually works.

        1. spankalee · · focus · HN ↗
          So any specifics on web components? What part is actually bad and how could it be better in a way that actually works?
          1. nananana9 · · focus · HN ↗
            Nitpicking specifics misses the elephant in the room:

            > figure out a sane way to do reactivity

            (100-epsilon)% of developers write websites in a reactive framework, and the reason we have so many of them is because the platform doesn't provide a sane way to do it, so we keep trying again and again with different hacks on top - virtual DOM, proxies, literal JS to JS compilers, whatever some crazy guy happened to come up with last weekend.

            That's the problem developers have, and WebComponents don't solve it. They can't. Nothing you do in the DOM can solve it, you need support from the JS side. Thus, lock the two working groups in a basement until they start talking to each other.

            All developers want to be able to do is write this:

              JS:
              let my_stuff = [1,2,3];
            
              HTML (made up template syntax, pick your favorite one)
              <ul><li><$for thing in my_stuff><li>$thing</li></$for>
            
              JS again
              my_stuff.push(4, 5);
              my_stuff.reverse(); // the user now sees 5 4 3 2 1
            
            A giant update that forces everyone to change to drop their workflow, but doesn't solve this was bound to be dismissed oturight.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.