Recent submissions

Comment · 3 years ago
Comment · 3 years ago
The main reason is that they're too low-level to use directly.

They do a lot, but stop just short of being useful without something of a framework on top. I tried hard to use them directly, but found that it was untenable without sensible template interpolation, and without helpers for event binding.

Here's my shot at the smallest possible "framework" atop Web Components that make them workable (and even enjoyable) as an application developer:

https://github.com/dchester/yhtml

It's just ~10 SLOC, admittedly dense, but which make a world of difference in terms of usability. With that in place, now you can write markup in a style not too dissimilar from React or Vue, like...

    <button @click="increment">${this.count}</button>
Whereas without, you need to bind your own events and manage your own template interpolation with sanitizing, handling conditionals, loops, and all the rest.

If we could get something in this direction adopted into the spec, it would open up a lot of use cases for Web Components that it just can't address as-is.

Comment · 3 years ago
Nice writeup. We're working on a framework with similar goals, here: https://github.com/frameable/el

Reactivity, composability, templates, etc with no dependencies, in ~150 SLOC.

Comment · 3 years ago
Comment · 3 years ago
Comment · 3 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
We developed El to be as minimal as possible, while still solving the problem of keeping state and interface in sync:

https://github.com/frameable/el

It's just ~150 lines / 2kb, and leverages existing browser functionality to accomplish most of the hard parts. Has observability, reactive templates, scoped CSS, no need for a build process, etc.

Comment · 4 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton