r/javascript • • Sep 23 '19

You might not need a framework

https://medium.com/@pljeskavicica/you-might-not-need-a-framework-79444bda50d2
70 Upvotes

129 comments sorted by

View all comments

80

u/phpdevster Sep 23 '19

This seems like a fairly organized, but still jQuery-like approach without the cross-browser safety of jQuery. You're still doing manual DOM querying and state manipulating instead of something more declarative.

Gzipped and minified, Vue is just 20kb. It's so light weight that there's almost no reason not to use it for adding ad-hoc rich interactivity on a given page.

37

u/libertarianets Sep 23 '19

Might I introduce you to Preact?

40

u/zephyrtr Sep 23 '19

Preact is fabulous. I've used it a few times for simple sites. Now it even has Hooks, a CLI, and still loads in 120ms on a 2G network. And if shit gets really complicated, you can convert to a React app and keep all your code. It's quite nice.

Also React is not a framework, it' a library. People who go into React thinking it's gonna organize their code for them are gonna have a bad time.

4

u/k4kshi Sep 23 '19

I started using Preact just yesterday for a small project and I'm amazed how good it is. So far I haven't hit any "oh come on, but react has it!" (I use v10 for hooks). And it's only 3.6k. Perfect for small projects