nodejs / node-eps

Node.js Enhancement Proposals for discussion on future API additions/changes to Node core
443 stars 66 forks source link

clarify the exact MIME for .mjs #61

Closed bmeck closed 6 years ago

bmeck commented 6 years ago

requested by https://github.com/jshttp/mime-db/pull/88

Trott commented 6 years ago

Arguably out of scope for this document, but if people are looking to us for the answer on MIME type, this is certainly the answer I'd expect us to give. So 👍

ChALkeR commented 6 years ago

The first part looks good:

The MIME used to identify .mjs files should be a web compatible JavaScript MIME Type

But I'm not sure about this

preferably application/javascript

because I don't know what's going on the application/javascript vs text/javascript question and which one is preferred now and by whom.

Perhaps /cc @domenic for that.

Note that I'm not implying that I prefer to see text/javascript there — I would have asked the exact same question if this change mentioned text/javascript as the preferrable mime type.

bmeck commented 6 years ago

@ChALkeR we could remove the second sentence?

ChALkeR commented 6 years ago

@bmeck I guess we could, this change would make sense even without mentioning the preferred one of those.

That addition of the preferred mime has its value, so if the decision could be made in a reasonable amount of time to favor one of those for some valid reasons, so I would prefer it to be mentioned, but if that won't be achieved — merging this without an exact preferred mimetype LGTM.

domenic commented 6 years ago

text/javascript is preferred on the web generally; I believe some RFC tried to obsolete it, but it's the most prevalent on the web, so the HTML spec just made it the default.

bmeck commented 6 years ago

linked to HTML spec and updated

ChALkeR commented 6 years ago

@bmeck I am still not entirely sure if the HTML spec is the correct source for this. What do other members of TC39 think? Is this opinion by @BrendanEich actual?

ChALkeR commented 6 years ago
domenic commented 6 years ago

HTML spec probably shouldn't be the primary source for JavaScript mime type.

I dunno. HTML is the spec for web browsers, and web browsers are the major client that (a) cares about MIME types and (b) executes JavaScript. So I think it's a pretty good place for it.

bmeck commented 6 years ago

I would agree with @domenic here

bmeck commented 6 years ago

@ChALkeR are you ok with text/javascript since it is a preference, and it is not a mandatory thing? Is it ok to merge this PR?

bmeck commented 6 years ago

landed in https://github.com/nodejs/node-eps/commit/6eef91d4ab4544ee5ed01df86dd7d055e90e130e

ChALkeR commented 6 years ago

@bmeck Sorry for a very delayed response on this :disappointed:, I had some personal availability issues, hopefully resolved now.

The PR as landed in 6eef91d looks good to me.