I'm working on a large site that has a lot of legacy code. Inline scripts, old libraries, etc etc. It's stuff that I can't blanket remove because it's being used on many pages, but we are moving in a new direction. Requirejs, marionette and backbone. I can't just take ALL of our thousands of lines of code refactor them. Not immediately anyways. So, in the mean time, we'll have a two headed monster. Legacy code the way it is, new code in the backbone, marionette, requirejs app.
My issue is with loading jquery in my current, very basic, requirejs based setup. I've got jquery v1.9.1 shimmed in to load before require, but it appears to be conflicting somehow with the different version of jquery(1.7.2) loaded from the head. Sitewide, all of the functions (such as the twitter bootstrap jquery based plugins, etc) that attach to the old version of jquery appear to get wiped out by the version of jquery I'm loading in with require. My guess is the shim, which loads jquery BEFORE any require based code, as far as I understand anyways, is killing my old jquery object.
How do I avoid this? How do I keep my new version of jquery contained to the require.js object and not have it interfere with the old legacy code?
Thank you very much. Code details can be provided if asked for, but I hope the concept of what I'm trying to do here is clear enough.