Skip to content

Add AMD support to jQuery.Transit architecture#64

Closed
levi wants to merge 3 commits intorstacruz:masterfrom
levi:master
Closed

Add AMD support to jQuery.Transit architecture#64
levi wants to merge 3 commits intorstacruz:masterfrom
levi:master

Conversation

@levi
Copy link

@levi levi commented Aug 13, 2012

I was unable to load jQuery.Transit in my Require.js environment. I wrapped the plugin in a method provided by the UMD spec to optionally allow it to export its namespace in an AMD when available. More info about the code update here: https://github.com/umdjs/umd

levi and others added 3 commits August 13, 2012 13:32
…orm). Namespace the transit transform property, so it doesn't conflict.
… performance of a few loops by using straight for loops rather than jQuery each iterators. Remove the transformOrigin and transition CSS hooks when using jQuery 1.8+, as jQuery now does those natively. Renamed the tranform hook to transit:transform to diaambiguate it from the browser's transform property, which fixes the issues from my previous patch.
@rstacruz
Copy link
Owner

Hm, I'm not convinced this is the right approach for everyone. Not all AMD environments has jQuery loaded via AMD, in which case, this will fail.

@rstacruz
Copy link
Owner

Closing this for now unless someone can contribute a better solution, perhaps a custom build script to make an AMD version. Discussions still welcome.

@rstacruz rstacruz closed this Dec 13, 2012
@levi
Copy link
Author

levi commented Feb 7, 2013

jQuery is exposed by default as an AMD module whenever there is an AMD-compatible adapter loaded into global scope. This will work regardless of Require.js, since this implements the UMD spec, a universal definition for AMDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants