Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiple Javascript frameworks in a project?

Is it good or okay to have several frameworks in a project, or is it bad because it gets cluttered (= a mess), and the loading times maybe get's longer. Does some 100 K matter really? Or should you stick with one?

like image 598
marko Avatar asked Dec 14 '22 00:12

marko


1 Answers

It's generally better to pick one thing and stick with it, for a number of reasons:

  • Fewer dependencies.
  • Lower complexity.
  • Easier to maintain.
  • Faster loading times.
  • No likelihood of dependency conflicts (i.e. jQuery can't conflict with your other Javascript framework if you only have one).
  • Lower debugging times.

It's true that an extra ~50k these days probably isn't going to kill anybody for a personal site or blog. The benefit comes when you scale to larger sizes, and all those extra 50k hits are eating into your bottom line. But even if you're just doing this for a small site, the savings on your sanity from figuring out problems quicker will easily be worth it.

That said, if you just need one part of a specific piece of a Javascript framework, the larger ones are often split into logical chunks, so that you can just take the piece you need rather than the entire framework. Most are rich enough these days that if framework X has a feature you want, but you're using framework Y, you can pretty much just map the source code for that feature directly into framework Y.

like image 99
John Feminella Avatar answered Dec 25 '22 13:12

John Feminella