ModuleLoader/es6-module-loader — pull request #98 by caridy (2014-02-24 17:19:32+00:00)
Title: splitting source code into different polyfills for better reusability

For your consideration:

We plan to have a big push on our next gen loader for yahoo, and for the OS YUI community in general, and we will like to use some of the pieces from the `es6-module-loader`, but not all of it. I'm reluctant to implement yet another polyfill, that's why this PR is proposing splitting the script `lib/es6-module-loader.js` into logical pieces, specifically into each individual polyfill (Module, Loader, Promise and System), so we can use `Loader` and `Module` in our project. Another possible solution will be to move Module and Loader to its own repo, introducing yet another library that `es6-module-loader` and others projects can use, I'm willing to do that if necessary as well.

I tried to keep things and style as close as possible to the original script, and the same for the build process and tests. It also proposes a small improvement in the way those polyfills attach to global (when in a browser or node), following the success with had with `Intl` and `messageformat` polyfills, which explicitly expose any polyfill under `global.Polyfill`, and conditionally expose `global.` to avoid overruling browser's specific implementations, and letting that in the hands of developers to do it manually if the feel the polyfill is a better fit for their needs (this is obviously not needed right now, but in the future it will be necessary).