Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What JavaScript frameworks conflict with each other?

There are times when I want to use mootools for certain things and Prototype & script.aculo.us for others but within the same site. I've even considered adding others, but was concerned about conflicts. Anyone have experience, or am I just trying to make things too complicated for myself?

like image 478
drye Avatar asked Oct 02 '08 20:10

drye


People also ask

What is the most powerful JavaScript framework?

1. Angular. One of the most powerful and efficient JavaScript frameworks, Angular is an open-source framework that is used for developing a Single Page Application (SPA).

What problems do js frameworks solve?

The main problem modern JavaScript frameworks solve is keeping the UI in sync with the state. It is not possible to write complex, efficient and easy to maintain UIs with Vanilla JavaScript. Web components do not provide a solution to this problem.

Can you use multiple JavaScript frameworks?

Projects In JavaScript & JQuerynoConflict() method allows you to use multiple frameworks, while using jQuery. Other JavaScript frameworks include Ember, Angular, Backbone, etc.

What are various JavaScript frameworks?

The five most popular JavaScript frameworks are Node. js, Vue. js, AngularJS, Ember. js, and React.


2 Answers

If you really, really want to do this, then you will be able to without too many problems - the main libraries are designed to behave well inside their own namespaces, with a couple of notable exceptions - from Using JQuery with Other Frameworks:

The jQuery library, and virtually all of its plugins are constrained within the jQuery namespace. As a general rule, "global" objects are stored inside the jQuery namespace as well, so you shouldn't get a clash between jQuery and any other library (like Prototype, MooTools, or YUI).

That said, there is one caveat: By default, jQuery uses "$" as a shortcut for "jQuery", which you can over-ride.

So, yes, you can do it, but you'd likely be creating maintenance headaches further down the line for yourself - subtle differences between framework functions may be obvious to you today, but come back in 6 months and it can be a whole other story! So I would recommend keeping it as simple as you can, and having as few different frameworks (preferrably 1!) as you can in your codebase.

like image 143
ConroyP Avatar answered Sep 22 '22 16:09

ConroyP


AFAIK, all the popular frameworks are designed to be combined with other frameworks. I don't think combining them is that much of a problem. I would however discourage combining them purely from a case of bandwidth needs. A slow site experience is less forgivable than a more complicated development experience.

like image 44
Joeri Sebrechts Avatar answered Sep 23 '22 16:09

Joeri Sebrechts