views:

32

answers:

1

I assume this would be an issue with any JavaScript framework.

I use MooTools on allot of the pages on my site. On some pages the scripts are 2 years old. When a new page needs MooTools I usually download the latest version to avoid any possible hang-ups with past bugs and to make use of any new features.

This has worked fine as my older pages still work and my new pages have the latest and greatest.

Recently I've wanted to use MooTools on page elements that are shared on all pages of the site. Like the site header or navigation.

I have not done this yet but I assume that having a site-wide version of MooTools will conflict with existing versions in use on older pages.

I'd hate to be committed to one version for the whole site, and only upgrading when I've tested all the older pages to ensure they didn't break with a new version.

Questions are: What options do I have? What solutions have you guys used that work? Is there a feature that allows for two versions to coexist on the same page?

+1  A: 

I would feel like something had gone really badly wrong if I had to serve up more than one version of any given library site-wide. So far I've been successful in avoiding that, even for a very (VERY) large web application.

When it's time to upgrade, you upgrade. When it's not, you stick with a back-rev library. That's the way things work in general in any professional software project I'm familiar with. I'm sure there are exceptions, but I would say that keeping and serving multiple copies/versions is never a desirable situation.

[edit] by the way this really isn't that different from similar issues with multi-component server-side systems, or old-school client-server systems.

[another edit] Note that your clients will have to maintain separate copies of your library in their browser caches, and as they hop from page to page they'll be pulling down new copies all the time when they visit after a long absence (and the cache is old, in other words). With just one copy, they only have to download it at most once per visit, and it's even better if you leverage something like Google for jQuery, or whatever.

Pointy