
Today’s Challenge: Build a 1KB Frontend Library
Let’s tackle an exciting challenge today: creating a frontend library that’s just 1 kilo...
For further actions, you may consider blocking this person and/or reporting abuse
Awesome project, especially because I think todays frameworks are way too bloated.
Btw. I also created a small anti-framework called InfrontJS.
I am really interested what you are coming up with. Maybe I can pick up some ideas for my framework if you dont mind ;-)
Oh, so these things are called anti-frameworks - good to know! Awesome site, and it's great to see your framework evolving! I still can’t manage to work on pet-projects with that level of discipline.
haha, I started the same way, 100LoC, template literals+observables (👎👎👎 signals lol), used to call it the "No Framework"... then it evolved into a UI library, slowly growing into a full, modular framework (going to happen to all of you, guys, it's a law of nature)...
Nice work, guys, both!
Good to meet some "same-minded" people here 👍
Thanks for your head-ups. Yeah, I came across the term "anti-framework" on a blogpost somewhere and somehow liked it ;-)
Create a comparative table with react-based "black spells". Your framework can win by simplicity. 😁
Very nice post! Thanks for writing it.
I used to do something like this, but I've moved back towards server-side rendering and inserting chunks of HTML on to the page, similar to how htmx does it. Works well in a surprisingly large number of cases, especially in cases where you'd have to persist the data server-side anyways. One of the things I miss with an approach like that is optimistic updates on the client side, which your library would handle well (render with the new data, then on error revert the data back to the old data).
I love the idea of copy-paste tools, for when you're working on a smaller project and don't really need all the weight of a full-fledged framework. I also love how small you were able to get this.
I had attempted to make a copy-paste framework once upon a time. It ended up being 1.5 kb gzipped. You got me beat :). But it looks like fundamentally, we took a similar approach, namely building everything on top of signals and an
html
template tag.I hope one day in the future these sorts of things can just be in native JavaScript.
Thanks! Really cool to see similar projects from like-minded devs! snap.js has way more features - no wonder the size is a bit bigger.
Great. I am militant of minimalisme🙂
Great attempt.
Wondering if that would work in complex applications…?
This implementation of signals definitely has its limitations. They're described in the article I linked to. Other than that, it's pretty standard and basic DOM manipulation. I'll write a separate article about optimizing list rendering.
now I wonder why so many people (incl. myself) keep re-inventing the same no-framework/anti-framework (ok, that's easy, that's the React/Angular Fatigue, right?), instead of teaming up and building something big together (ego, perhaps? Everybody wanting to become "the man" who changed the world and get 100% of the credit? Other realistic explanations? I did it because I needed a framework and was in total disagreement with the approach taken by most existing ones. How about you guys?)...
So in the end there are dozens of talented creators around who built 100% of something nobody uses and knows about, even if it's a brilliant product that would deserve taking over the market...
To dominate the market, you need marketing. So, in my opinion, it’s not about ego or chasing GitHub stars. It’s more about sharing what you’ve built because you genuinely enjoy it and find it interesting.
useless
why are you using a WeakSet for disposed?
WeakSet allows garbage collection of disposed effects, so it should be more memory efficient.
after every framework, I see react still right from the beginning