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.

3

u/unc4l1n Sep 23 '19

The parsed size is obviously much more, and on crappy mobiles it takes an age. Network is not the bottleneck for JS on mobile.

3

u/phpdevster Sep 23 '19

I've built plenty of sites and pages that use everything from a sprinkling of JS for form validation, to complex tables with client side search, sort, dynamic dropdown filters in the headers whose contents react to the results in the table, and custom cell rendering. They all work fine on my crappy iPhone 6, which is brought to it knees by all recipe sites and blogs and what not.

You will only run into issues on mobile if you're building big SPAs, but if you're building big SPAs without a framework, good luck to you.

1

u/unc4l1n Sep 23 '19

20KB gzipped is like 80KB to parse/compile. On an average mobile (not high end) that will take around 2s. This is not to be taken lightly.