rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.29k stars 863 forks source link

Add AMD support to jQuery.Transit architecture #64

Closed levi closed 11 years ago

levi commented 12 years ago

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

rstacruz commented 11 years ago

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 commented 11 years ago

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

levi commented 11 years ago

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.