system module loader

# Mike Samuel (14 years ago)

harmony:module_loaders mentions a system module loader.

Has the behavior of the system module loader been speced at all?

If not, would it be worthwhile specifying that when it loads an http or https URL, it does so with a fairly minimal Accept header that excludes non-script mime-types, especially text/html and /:

Accept: application/javascript;version=next, application/javascript

or whichever is the preferred mime-type.

Such a hint might be of use to application frameworks like RoR that have a translation pipeline so that when the accept header does not include application/javascript;version=next then they can try and desugar to ES5, but when the user-agent does, they can deliver individual modules with spiffy new features.

# David Herman (14 years ago)

On Mar 8, 2012, at 9:27 AM, Mike Samuel wrote:

harmony:module_loaders mentions a system module loader.

Has the behavior of the system module loader been speced at all?

Not really. The plan is to leave it mostly unspecified; it's sort of the "Pineal gland" of ES6 [1], so most of the questions of how it interacts with the host environment and what extra built-ins are in its global object are, as usual, up to the implementation.

If not, would it be worthwhile specifying that when it loads an http or https URL, it does so with a fairly minimal Accept header that excludes non-script mime-types, especially text/html and /:

Accept: application/javascript;version=next, application/javascript

or whichever is the preferred mime-type.

Such a hint might be of use to application frameworks like RoR that have a translation pipeline so that when the accept header does not include application/javascript;version=next then they can try and desugar to ES5, but when the user-agent does, they can deliver individual modules with spiffy new features.

Great idea! I like it.

Dave

[1] en.wikipedia.org/wiki/René_Descartes#Dualism

# Mike Samuel (14 years ago)

2012/3/8 David Herman <dherman at mozilla.com>:

On Mar 8, 2012, at 9:27 AM, Mike Samuel wrote:

Has the behavior of the system module loader been speced at all?

Not really. The plan is to leave it mostly unspecified; it's sort of the "Pineal gland" of ES6 [1], so most of the questions of how it interacts with the host environment and what extra built-ins are in its global object are, as usual, up to the implementation.

Would that make proxies the homonculus of ES6?