← Back to context

Comment by zdragnar

4 hours ago

The APIs are expensive for storing state (read access on attributes) and expensive to write (so many ways to trigger reflows and paints) without a good way to batch them.

WCs have tons of boilerplate to them, such as extra song and dance to make attributes observable. In fact, a custom element can have an attribute and a property with the same name, and they are managed separately unless you explicitly set them up to sync. It's a terrible design.

Built-in things aren't extensible - there's no way to have a number type input that doesn't suck without doing it yourself, and then you need to opt into extra song and dance for your element to participate in form submission data.

There's a reason popular frameworks are popular. They're good enough, you can hire people who already know them, and you benefit from the maintainers fixing bugs for you.

It sounds like you are trying to force framework insanity onto the vanilla APIs. That is insanity, but I know why you are doing that... its what you know.

The good thing about the vanilla APIs is that you don't have to do knowingly broken things. The APIs themselves are stupid fast.

When I need to store state I put all the state goodness into a single object. Just one object, and its generally small even on extremely large applications. I update that object as often as the user interactions dictate. I let the needs of the application determine where that object is written: localStorage, a file, a database, or something else. I only ever need the state object when the page loads or reloads, because I am not doing things some weird framework way.

Built-in things are represented as data structures, so they are inherently as extensible as your programming capabilities allow.

> There's a reason popular frameworks are popular.

Because that is what employers dictate for hiring. If you want to work you have to do the stupid things for newbs. Framework popularity also does not indicate other positive qualities. These popular frameworks are the primary reason so many people on here bitch about the bloated web.