Tuesday, 13 August 2013

Is there a javascript loader that supports using multiple versions of common libraries in the same browser window?

Is there a javascript loader that supports using multiple versions of
common libraries in the same browser window?

We have a system where multiple back-end services serve up front-end
content that ultimately gets combined into a single web page.
Currently, we use the YUI3 loader to support javascript and css dependency
management for YUI and other javascript libraries (e. g. jQuery,
knockout).
What I'm wondering is, is there a way (using YUI3's loader or some other
loader) for this process to be robust to having multiple versions of a
library on a page?
For example, if all consuming code took the $ object as an argument rather
than using the global $, then theoretically the loader could store a copy
of $ version 1.1 and $ version 1.2 outside of global scope and pass these
objects to the consuming code as appropriate.

No comments:

Post a Comment