Skip to content

Adding .mjs to list of known MIME types#34318

Merged
BrennanConroy merged 2 commits intomainfrom
shirhatti/mjs
Jul 15, 2021
Merged

Adding .mjs to list of known MIME types#34318
BrennanConroy merged 2 commits intomainfrom
shirhatti/mjs

Conversation

@shirhatti
Copy link
Contributor

https://datatracker.ietf.org/doc/html/draft-ietf-dispatch-javascript-mjs has been submitted for publication to the IESG. We anticipate that browsers may start enforcing the correct Content-Type header for javascript modules prior to execution.

As an aside, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#aside_%E2%80%94_.mjs_versus_.js

👀 @MylesBorins

https://datatracker.ietf.org/doc/html/draft-ietf-dispatch-javascript-mjs has been submitted for publication to the IESG. We anticipate that browsers may start enforcing the correct `Content-Type` header for javascript modules prior to execution.

As an aside, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#aside_%E2%80%94_.mjs_versus_.js
@shirhatti shirhatti requested a review from Tratcher July 13, 2021 22:58
@shirhatti shirhatti requested a review from BrennanConroy as a code owner July 13, 2021 22:58
@ghost ghost added the area-runtime label Jul 13, 2021
@MylesBorins
Copy link

this looks great @shirhatti The only thing I'll point out is that browsers already do enforce the correct Content-Type header for JavaScript modules which is exactly what makes the lack of .mjs support from mime type database an issue (and a primary motivation for standardization at the IETF)

@shirhatti shirhatti added the community-contribution Indicates that the PR has been added by a community member label Jul 14, 2021
@shirhatti
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@javiercn
Copy link
Member

@shirhatti this also needs tooling support, since VS will not colorize .mjs files

…r.cs

Co-authored-by: Stephen Halter <halter73@gmail.com>
@BrennanConroy BrennanConroy enabled auto-merge (squash) July 14, 2021 22:29
@BrennanConroy BrennanConroy disabled auto-merge July 14, 2021 22:29
@BrennanConroy BrennanConroy enabled auto-merge (squash) July 14, 2021 22:29
@halter73
Copy link
Member

Triage note: This is different than .js which is still "application/json". We're okay with this since we expect we'll eventually address .js when we resolve #34323.

We anticipate that browsers may start enforcing the correct Content-Type header for javascript modules prior to execution.

@shirhatti Do you really think this is likely? Why would a browser be that strict and reject "application/json".

@shirhatti
Copy link
Contributor Author

@shirhatti Do you really think this is likely? Why would a browser be that strict and reject "application/json".

That was phrased poorly. I don't expect browsers to stop executing application/javascript, but they will not serve mjs files without text/javascript or application/javascript

@BrennanConroy BrennanConroy merged commit 8792f3a into main Jul 15, 2021
@BrennanConroy BrennanConroy deleted the shirhatti/mjs branch July 15, 2021 01:32
@ghost ghost added this to the 6.0-preview7 milestone Jul 15, 2021
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants