3 ms·
I've been working on a webcomponent based reddit/patreon competitor for about a year now, and one thing I found was how incredibly easy it was to spin up my own
by jjcm 6y ago
I've been working on a webcomponent based reddit/patreon competitor for about a year now, and one thing I found was how incredibly easy it was to spin up my own micro framework.
I would highly encourage people to give it a shot. It's just going back to basics and working with class-based inheritance. It will take you a day to write out the basic functions you will need for 95% of your components, and you'll be left with a tiny library that not only solves your needs, but you know inherently.
If you're curious, lines 1-26 are all you need to easily bind an html block, a style block, and to do event/attribute binding via @/? statements: https://github.com/jjcm/soci-frontend/blob/master/components/soci-component.js https://github.com/jjcm/soci-frontend/blob/master/components... . The rest of the file are just shared helper functions.
- BigJono 6y agoDon't be stupid, how do you know those 26 lines of code are free of bugs? They're not battle tested and you're just re-inventing the wheel instead of following best practices.
- DonHopkins 6y agoThat's right, we should all follow best practices and use 26,000,000 lines of Angular code, which has been written and debugged by thousands of people, battle tested and wounded and scarred in wars we've never heard of and don't care about, and that we will never get around to reading all of.
- BigJono 6y agoThose 26 million lines of code have been engineered over the better part of a decade to perfectly cater to every possible use case. To not leverage those productivity gains would be insane. You wouldn't build your own car would you? (/s, btw)
- tinco 6y agoA friend of mine did the same thing, I did a small project in his framework and it was really fun. https://github.com/ruphin/gluonjs https://github.com/ruphin/gluonjs I'm not sure if he still maintains it or it's just done, it grew to about a hundred lines but it's quite comfortable. He used it himself to create a quite amazing portfolio page that unfortunately is down right now.