The recent change in module name to FileSaver.js has broken our requirejs optimization step. I don't think it likes having a ".js" at the end. Also as this is a breaking API change it should really have a new major version number!
The requirejs docs suggest module names aren't required, is there a reason for this module to have an explicit name?
It is normally best to avoid coding in a name for the module and just let the optimization tool burn in the module names. The optimization tool needs to add the names so that more than one module can be bundled in a file, to allow for faster loading in the browser.
I was very surprised that latestet build of my application suddenly stopped working, because of that. Also version name in file header is not updated so it was very confusing.
Had to revert to previous version due to this issue.
In general modules should not name themselves, and as James Burke suggests, a module should not force a module ID in its define() call.
@jimmywarting well, we had never such issues/errors from RequireJS with this library before that change, and due to the name assigned now, conflictong with the file name, we can't even use RequireJS mappings. So, either name should be removed, or updated, having no '.js' in it!
Situation in #159 is caused by wrong requirejs usage. Someone is using requirejs, but loads FileSaver.js by script tag instead of "require". It should never be accepted as solution.
@eligrey what do you think?
Dose it work if we just rename it to just FileSaver here and bump the version to 2.0.0?
I'm uncertain what to do to satisfy this and #159. Haven't worked with RequireJS...
If you're going to keep the hardcoded name for the module, I'd suggest using file-saver instead of FileSaver to match the bower and npm module naming, and the example in this module README:
var FileSaver = require('file-saver');
var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
I'd still suggest follow the RequireJS practice and not to force any name, and let @zky829 use AMD modules as designed.
I agree, reverting 8739c46 and publishing under 1.3.x would be preferred.
@headlessme Sure. Either me or @jimmywarting will revert to not using any name soon (once I get some more time this week).
Hello, I had to revert to 1.3.2 due to this issue. It would be great to have it fixed.
We want to bump that issue once again, please
This is biting me as well; would like to see the change reverted.
Second that
Fixed by #391
Most helpful comment
@headlessme Sure. Either me or @jimmywarting will revert to not using any name soon (once I get some more time this week).