• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

avoiding jQuery for SPAs?

 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear, I'd like to hear your take on this article. I admit the article is a bit over my head.

Do you think this is something that just affects Embers apps or is this something that all jQuery developers need to watch for?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not being very familiar with Ember, I didn't delve deeply into the examples and problem descriptions enough to give a detailed analysis. On the surface, my impression is that there could be an issue with unneeded code hanging around a page too long (as if that's never been the case) when using component-based Ember or similar frameworks.

A case for whether it's particularly applicable in other environments was not made.

But the point that modular code should be able to be easily removed when no longer needed on long-lived pages is an accurate one. It's something that we need to be thinking about.

But singling out jQuery specifically as a culprit seems a tad witch-trialish -- most code written up to this point for any environment hasn't given much thought to this. The "the sky is falling" tone of the article is a bit put-offish as well.
 
J. Kevin Robbins
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear. I haven't used Ember or looked at SPA frameworks, so this is new to me, but I use jQuery and various plug-ins every day so I was a little concerned by this article.

btw, by addressing Bear, I didn't intend to exclude any one else from the conversation. If anyone has anything else to add, please chime in.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know Ember.js but for the time being it should be the least jQuery hostile framework as Ember's code base seems to occasionally use jQuery itself (https://github.com/emberjs/ember.js/search?utf8=%E2%9C%93&q=jQuery, which isn't that surprising). That being said there seems to be some suggestion that jQuery shouldn't necessarily be the first tool to reach for when you are using Ember: jQuery to Ember: How to Make the Jump Without Falling - YouTube and

No, really, Let Ember handle things!


The Top Mistakes Developers Make Using Ember & Rails - 4 Ember isn't jQuery, either
Basically jQuery is safe as long as nothing else is competing for access of the DOM - things change once a framework wants (preferably) exclusive control of the DOM. In general once you are using a framework you should always find out whether there is a way to do something through that framework first before you get another library involved (even if you already know how to do it with that other library) or even use the browser API. Unfortunately every framework/library "has its own way of doing things" so there is always yet another learning curve to deal with (discovering what your tools are doing for you under the hood can sometimes help flatten the curve the next time around).

In the end the question that really needs to be asked much more often: "Is implementing this web application as a Single Page Application the best solution?"

For the time being counter-movements like ROCA (Resource-Oriented Client Architecture) are being largely ignored (where jQuery libraries are listed among others under ROCA JavaScript Libraries). But there are cases where organizations have gone from front-end page generation back to rendering pages on the server side:
Improving performance on twitter.com | Twitter Blogs
Delicious Changes | The Official Delicious Blog

... so in some instances the issue should be more about avoiding SPAs - though be prepared for accusations of being "anti-progressive" and "stuck in the past".
Why I hate your Single Page App — Medium
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic