jquery.fileDownload
jquery.fileDownload copied to clipboard
Make an AMD-Friendly build
This plugin is currently difficult to load with require.js. I could wrap it manually but that would break package management with volo. It would be nice to see it wrapped in a UMD https://github.com/umdjs/umd/blob/master/returnExports.js
Any update on this?
I haven't heard anything
Hey folks,
While I agree using a UMD might make sense for some module types depending on your application, once you load jQueryFileDownload it exists on jQuery for the life of the page. (It is attached, namespaced, whatever you want to call on jQuery) Having it be a UMD would be a little strange since you couldn't actually inject the module in and use it as an injected module, you would just need to know that its part of jQuery after you've added reference to it or something. Am I missing something with that?
The issue is less that and more that it doesn't declare it's dependency on jquery forcing people to use shims. As for your concern, typically what is done in scenarios like this is that you register it to jquery as before and just return the same jquery object.
I'm not huge on AMDs but feel free to do a pull anyone that would like and I'll merge it stat
Already in the PR attached to this issue from a year ago
ahh sure, sorry I'm used to seeing it a different way. I'll get it added (probably copy+paste) style by this weekend and put your credit on it. Thanks!
Problem still occurs on master bunch (version 1.4.4 This is relay simple fix just add a UMD factory to your namespace
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', window], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('jquery'), window);
} else {
factory(jQuery || Zepto, window);
}
}(function($, window){
..... your code goes here ....
}));
any news?