TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to avoid common SPA pitfalls when using third-party plugins

66 pointsby gandalfarover 9 years ago

10 comments

unit91over 9 years ago
I liked his examples, though I disagree with his conclusion (don&#x27;t use jQuery). It seems like the real conclusions are:<p>1. understand the language you&#x27;re using (this would solve the `bind` examples); and<p>2. learn how to use your libraries properly.<p>Otherwise, the &quot;don&#x27;t use $TOOL, because misuse can cause $BAD_THINGS&quot; line of thinking is nearly limitless in its application (jQuery, cars, circular saws, ...).
评论 #10976582 未加载
评论 #10976664 未加载
jonesb6over 9 years ago
Most of OP&#x27;s complaints come from the misuse of JQuery, including compounded performance issues when paired with a SPA framework (in this case Ember, which IIRC has a dependency on JQuery either way). Slow + Slow = More slow.<p>Honestly it&#x27;s a library. Use it, don&#x27;t use it, replace it, it honestly isn&#x27;t worth a million identical arguments. People like to use JQuery as a microcosm for bad javascript practices but guess what JQuery didn&#x27;t make you do it! It&#x27;s just a library.<p>There is no real reason to avoid JQuery. Sure you should, as a good developer, explore alternative solutions for different problem sets. Maybe those alternatives become the standard for your team, maybe they don&#x27;t. But unless you made a meaningful discovery that can add to the conversation, you don&#x27;t need to make another blog post about it. Ugh.
评论 #10976809 未加载
评论 #10976655 未加载
Bahamutover 9 years ago
Most of the advice sound like basic JavaScript - avoid things that prevent the interpreter from garbage collecting.
评论 #10976802 未加载
GavinMcGover 9 years ago
What was the fake reason to avoid jQuery?
评论 #10978084 未加载
评论 #10976789 未加载
SimeVidasover 9 years ago
“<i>Some people</i> write crappy jQuery code → jQuery is bad for <i>you</i>.” Never gets old :P
EugeneOZover 9 years ago
jQuery is not jQuery plugins. It&#x27;s ... not smart to write about them like it is one monolith thing.
评论 #10976810 未加载
frandroidover 9 years ago
I think the title is a bit short. It should have been &quot;The real reason to avoid jQuery with SPA frameworks&quot;.
评论 #10976834 未加载
WAover 9 years ago
tl;dr: Use jQuery + plugins, if you want to do some small UI improvements in JavaScript and don&#x27;t make it too complicated.<p>Learn a lot more about jQuery, if you write complex JS applications (like single-page apps) with the help of jQuery.
评论 #10976697 未加载
arsover 9 years ago
None of this is about jQuery - you can have the exact same problems in native JavaScript.<p>This page should be titled: &quot;Don&#x27;t forget to delete unused JavaScript things (nodes, events, etc)&quot;.
Khaoover 9 years ago
The real reason to avoid single page apps.
评论 #10976575 未加载