Live data from Hacker News

Building a front end framework – Reactivity, composability with no dependencies

18alan.space

41–50 of 80 posts

Re: Building a front end framework – Reactivity, composability with no dependencies

#41
post #38

Please don't make websites dark mode only. This is terrible for accessibility. I have astigmatism and can't read more than a few paragraphs. https://medium.com/@h_locke/why-dark-mode-causes-more-access... If the issue is not wanting to spend a bit of effort to implement prefers-color-scheme then light mode is a much better default option.

Maybe this is why I cannot read dark mode websites at all. Even coworkers with dark mode themes on their IDE are completely inscrutable to me.

Re: Building a front end framework – Reactivity, composability with no dependencies

#42
This is good progress. I hate that i can't do progressive enhancement on pure html form with Frontend Framework.

Example, RoR already provides powerful good library like SimpleForm. Now i want to turn this html form into a React form, how ?

Re: Building a front end framework – Reactivity, composability with no dependencies

#43
post #14

New front end frameworks that claim leaps in simplicity feel like the violate some kind of no free lunch principle to me. If they’re that simple, then I’m willing to bet they make some use cases very difficult or impossible

Web components weren't as widely available as they are now when most web frameworks were written.

Re: Building a front end framework – Reactivity, composability with no dependencies

#44
post #14

New front end frameworks that claim leaps in simplicity feel like the violate some kind of no free lunch principle to me. If they’re that simple, then I’m willing to bet they make some use cases very difficult or impossible

Depends on the definition of simplicity. People say they want simple, but then really want easy. The most easy is always somebody doing the work for you. I got tired of hearing people mention easy when really they probably mean some combination of fearful and/or lazy, so I chose to define easiness: https://github.com/prettydiff/wisdom/blob/master/Easiness.md If developers really wanted simplicity or to be done with w…

Thanks for sharing this. I’ve been recently into the concept of Digital Gardens where you evolve concepts and expand them over time (instead of the traditional chronological blogging style) and this is exactly the result that I imagine a page should look like when matured enough.

Re: Building a front end framework – Reactivity, composability with no dependencies

#45
post #14

New front end frameworks that claim leaps in simplicity feel like the violate some kind of no free lunch principle to me. If they’re that simple, then I’m willing to bet they make some use cases very difficult or impossible

I would argue rather that the amount of complexity that frontend web devs put up with is more of a Stockholm Syndrome situation. You can be much simpler than most mainstream frameworks, using only standard JS, CSS, and HTML, and acheive better results.

Using custom elements and shadow DOM like this post is a big part of that. Custom elements give you a built-in component module, shadow DOM gives you compositions and style scoping.

I think using proxies like this post is a challenging because proxies are very hard to get correct when dealing with methods, collections, object identity, privacy, etc. but it turns out that many applications do just fine with a simple Redux-like store / action / subscribe system for data.

I personally think the project I work on (https://lit.dev) hits a sweet-spot of simplicity vs complexity because it also gives component reactivity, declarative templates, embedded CSS, with standard syntax and no build tools required. In more than 400 LoC, but only by ~3x.

Re: Building a front end framework – Reactivity, composability with no dependencies

#47
post #5

This is great! I've been looking for a framework with exactly these goals. I've been using vanilla JS and custom elements and feeling like I'm writing too much boilerplate, but all the frameworks I've tried are too heavyweight.

Have you tried Lit yet? It gives you a reactive base class and declarative templates. Plain JS and no build step (or you can use TypeScript).

Re: Building a front end framework – Reactivity, composability with no dependencies

#48

Nice write-up, I look forward to seeing how Strawberry progresses. I keep a list of JS front end frameworks where no build step is required at https://unsuckjs.com/ . I'll add this there (and a few of the others mentioned in the comments here).

Lit 2.x is compatible with IE11, btw.

We're actually removing that in the upcoming 3.0 branch though.

Re: Building a front end framework – Reactivity, composability with no dependencies

#49
post #17

Earlier quoted context omitted.

Not always, some can hit the sweet spot of being simple in all phases of development and quick to learn. They are super rare though and their lessons are forgotten; industry often standardizes on inferior things with better marketing.

What are some examples?

I think Alpine.JS hits this spot pretty well.

https://alpinejs.dev/

Re: Building a front end framework – Reactivity, composability with no dependencies

#50
post #38

Please don't make websites dark mode only. This is terrible for accessibility. I have astigmatism and can't read more than a few paragraphs. https://medium.com/@h_locke/why-dark-mode-causes-more-access... If the issue is not wanting to spend a bit of effort to implement prefers-color-scheme then light mode is a much better default option.

I do not have astigmatism (or at least I think I don’t) but I notice that the rows of white letters stay burned in my vision, the contrast was so high it’s as if I am staring at small strong light sources.

So I prefer black letters on light background.

Post reply on HN