by fy20 · 2mo ago · 0 comments
I was building web apps like this until 2017 when I entered the React + Typescript world. For B2B you can get pretty far, rendering HTML on the server is fast! I was using Rails on the backend, so templates, partials, shared chunks, made it easy to manage and have a consistent UI without repeating too much.
The hard part is when you then need to build an infinite scrollable table, that has bulk select, and in-placs updating of columns. Ok maybe that's a bit too extreme the other way, but when you get to the point where it's easier to build full-on frontend components, you basically have to use a JavaScript framework for your entire UI. And they are basically all or nothing.
Last time I checked (a good few years ago; I gave up and accepted un-optimized frontends as the rule) there wasn't really a good way to do progressive ehancement like the above: the page rendered on the server as HTML, and some components then become fully frontend managed. And no, frameworks like Stimulus and HTMX don't really solve it for me, I want something declarative.
I'm a bit pissed off with DHH, that he went so far in the anti-Javascript direction, as IMO that was one of the big factors in Rails loosing it's limelight status. For backend I still haven't found anything as easy and fun to work with.
https://eric-frost.github.io/solarite/
I was also tired of the "all or nothing" of other libraries. Just let me import a js file and then make a class that's a web component. I don't want to setup a whole dang build environment.
With Solarite you just write the markup as a javascript template, change your data however, and then call render(), where it only updates the DOM that should change.
And you can use the component as a tag in your server-rendered page.