Issue 34875: Change .js mime to "text/javascript" - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ammar2, arhadthedev, asvetlov, mylesborins, wangjiahua
Priority: normal Keywords: patch

Created on 2018-10-02 22:28 by mylesborins, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 9678 closed mylesborins, 2018-10-02 22:39
PR 30740 open wangjiahua, 2022-01-21 08:03
Messages (7)
msg326920 - (view) Author: Myles Borins (mylesborins) * Date: 2018-10-02 22:28
I propose to change the mapping of file extension .js to mime type "text/javascript" from "application/javascript.

"text/javascript" is the currently documented best practice in the whatwg HTML spec.

https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
msg326923 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2018-10-02 23:21
It should be noted that the HTML spec also says:

The term "JavaScript" is used to refer to ECMA-262, rather than the official term ECMAScript, since the term JavaScript is more widely known. Similarly, the MIME type used to refer to JavaScript in this specification is text/javascript, since that is the most commonly used type, despite it being an officially obsoleted type according to RFC 4329.

https://html.spec.whatwg.org/#dependencies:willful-violation
msg327006 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-10-03 19:43
By RCF 4329 https://tools.ietf.org/html/rfc4329#page-9 text/javascript is obsoleted, application/javascript is a part of the standard.

WhatWg is a controversial group. Their specs don't always follow official standards but Python does.

Sorry, I should decline the proposal.

Feel free to raise an issue again if IETF will change their opinion.
msg327007 - (view) Author: Myles Borins (mylesborins) * Date: 2018-10-03 19:49
There is a IETF proposal that would make "text/javascript" no longer obsolete.

Will revisit at the point this lands

https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/
msg327010 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-10-03 19:55
We can return to the question when (and if) the draft will be accepted.
msg345883 - (view) Author: Myles Borins (mylesborins) * Date: 2019-06-17 17:49
Hey All,

I'd like to reopen this. We are almost done with the IETF standardization of .mjs, and part of this process is making obsolete application/javascript in favor of text/javascript.

--> https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/
msg411109 - (view) Author: Oleg Iarygin (arhadthedev) * Date: 2022-01-21 11:06
Myles, it looks like the draft 14 contains a mismatch in 6.2.1:

> # 6.2.1. text/ecmascript
>
> Type name: application
> Subtype name: ecmascript

In header it's `text`, in details it's `application`. Is it intended?

I believe that a typo wouldn't pass though fourteen revisions but nevertheless, just to be safe.