5 ms·
I migrated from jQuery to React, never going back and I wouldn't use jQuery for a new project. I agree that jQuery is ok for simple things, however I'd probabl
by KajMagnus 8y ago
I migrated from jQuery to React, never going back and I wouldn't use jQuery for a new project.
I agree that jQuery is ok for simple things, however I'd probably prefer something more light weight, like Bliss.js instead. jQuery's 30kb bundle size does make pages load slightly slightly slower on mobile phones, in comparison to Bliss (about 3kb last time I checked).
- sebazzz 8y agoMigrate from jQuery to React. You make it sound trivial but it is essentially a complete new way of developing the front-end. Not necessarily a SPA, but certainly a front-end with more interactivity than a few buttons and dialogs. In my experience React front-ends are more driven by separate data retrieved and stored at the server, while jQuery front-ends are mostly server-side rendered and jQuery is used for some degree of dynamic flexibility.
- austincheney 8y agoHave you considered authoring code without either of those tools? Then you can independently add in the appropriate tool to adjust for efficiency. Thinking in terms of the tooling first is premature optimization. Focus on the end product first, and the correct tooling (if any) will be clear.
- Spivak 8y agoI honestly don't think that dev workflow is even possible with most frameworks. It's not like you can take an existing website and add interactivity or extend the existing interactivity with React. The current landscape of web tools is pretty much that you have to call your shot from the beginning or suffer a rewrite later.
- austincheney 8y agoThat is certainly true once a framework is chosen, but before that you can prototype in many directions and extends in pieces. Extending a site to use a framework is not all or nothing.
- nerdwaller 8y agoYou seem to assume that jquery isn’t already cached by the client. Given the widespread usage, while granted may be shrinking, the “bundle” may never be downloaded again; Assuming that’s the case, the download is moot, and more favorable, verses the SPA with some cache busting mechanism (that may release once per week or once per hour).
- jcutrell 8y agoThis is very rarely true, and often cited. Too many sources to get reasonable gains for cached jQuery. There was a good article breaking down exactly why this is a few years back. Mobile but someone else can probably share.
- peteforde 8y agoAs cited elsewhere in this thread, jQuery is in use on >75% of the web. The only way you don't have jQuery cached is if you don't regularly use the web.
- austincheney 8y agoWhich version cached?
- extra88 8y agoOther sites' use of jQuery only helps if everyone is loading the same URL, which they're not. There are too many versions in too many places. I think I know the article they were thinking of, where someone tested how common it was for different sites to load libraries from the same place, it was not great. jQuery.com doesn't mention linking to it, only downloading, and references to their CDN and other CDNs is at the bottom of their Download page. They focus on the download option probably because people generally want to have more control of their sites and would rather have "their" jQuery file be loaded from the same CDN as their site's other assets.
- EB66 8y agojQuery and SPAs don't have to be mutually exclusive. At my work, we've been building SPAs with jQuery long before Angular or React even existed. More recently, we've built our own JavaScript SPA framework whose components can be written with vanilla JS or jQuery. Most of us prefer to use jQuery for our components because the syntax is often more expressive and concise than vanilla JS. We recently open sourced the framework: http://github.com/elliotnb/nimbly http://github.com/elliotnb/nimbly
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- mtzaldo 8y agoI mixed jquery + redux. I only use those 2 libs: https://github.com/mtzaldo/jqueryredux https://github.com/mtzaldo/jqueryredux
- hpaavola 8y agoMinified jquery (https://code.jquery.com/jquery-3.3.0.min.js https://code.jquery.com/jquery-3.3.0.min.js) is 86 927 bytes and minified bliss (https://blissfuljs.com/bliss.min.js https://blissfuljs.com/bliss.min.js) is 11 823 bytes. After gzipping those with 7-zip (on windows now, too lazy to do anything other) the sizes are 4 035 bytes for bliss and 29 495 bytes for jquery. The same in table: minified min+gzip jquery 86 927 29 495 bliss 11 823 4 035
- baddox 8y agoAnother vote for React here. I wouldn’t let jQuery anywhere near an app I was responsibility for. It’s a great and really well thought out tool for doing things that I absolutely never ever want to do in any non-trivial app I work on.