Settings

Theme

Show HN: Solarite – fast and simple web components with no signals and no build

eric-frost.github.io

3 points by EricFrost · 4 comments · 1 min read

Reader

I started Solarite several years ago because I wanted something simpler to use than the existing js ui frameworks. Features like:

- not having to setup a build environment or wait for compilation

- no signals or other dance to setup my data

- class based components, where I could pass arguments to sub-components as constructor args

- scoped styles, two-way binding and other nice to haves.

- not having the limitations of shadow dom (Lit)

- Just be a library I can import anywhere, not be a whole framework.

I wasn't able to find anything that did all of the above. It has a score of 1.08 on the js-framework-benchmark, which is faster than just about every widely known competitor, and most of the faster ones have implementation note "penalties" for not conforming to the benchmark requirements.

Source: https://github.com/eric-frost/solarite Docs: https://eric-frost.github.io/solarite/docs/ Js-Framework-Benchmark: https://krausest.github.io/js-framework-benchmark/current.ht...

I've used Solarite in production for a few years on a large internal work project, but I could use more feedback on the API before I feel comfortable releasing version 1.0.

2 threads
brazukadev

It is such a coincidence to find your project. ShadowDOM is my biggest issue with WebComponents and I got to a solution similar to yours.

Did you implement <slot> for light DOM or just use attributes?

  • EricFrostOP

    Yes, Solarite will take any children of your element and reparent them into a <slot> element if your component has one. Or just append them to the end if not.

gandreani

What limitations of shadown dom are you referring to? I use Lit (just a bit) and I'm not familiar with any limitations

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection