Reputation: 9837
When using a JQuery plugin, is it a good idea to cut it down in order to only leave the parts necessary for your application or is it better to leave it as it is?
In a related question, is there an impact in performance having to load the entire plugin instead of only the parts you need?
Upvotes: 0
Views: 80
Reputation: 9993
You could use Require.js (http://requirejs.org/) to manage what plugins need to be loaded on each page or event
Upvotes: 0
Reputation: 5308
There is always an overhead in loading any code (whether you need it or not):
However, there is also overhead in stripping down a plugin in that you are basically taking on responsibility for ongoing maintenance and you may introduce bugs inadvertantly.
My advice would be to only use plugins you genuinely need, and to vet the plugins to ensure code quality and that the feature set matches your requirements.
Upvotes: 5