jorendorff / js-loaders

Pseudoimplementation of the proposed ES6 module loaders.
54 stars 7 forks source link

System loader custom header #94

Closed guybedford closed 10 years ago

guybedford commented 10 years ago

If the System loader were to provide a fetch header, something like:

  X-System-Loader: spec-2.3.2

Say with the spec version descriptor, or at least just the custom header, then it would be possible to know that the browser supports ES6 modules and the server could deliver ES6. The polyfill would then have a different header, informing the server to deliver AMD for the same URL, resulting in a sensible backwards-compatible path to ES6 adoption.

guybedford commented 10 years ago

Admittedly, this same logic could probably happen by having the polyfill provide a header and the system loader not, which is probably more sensible actually!

Closing.