Skip to content

Change .js mime to "text/javascript" #79056

Description

@MylesBorins
BPO 34875
Nosy @asvetlov, @ammaraskar, @MylesBorins, @180909, @arhadthedev
PRs
  • bpo-34875: change .js mimetype to text/javascript #9678
  • bpo-34875:Change .js and .mjs mime to text/javascript #30740
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2018-10-02.22:28:39.501>
    labels = ['library', '3.9', '3.10', '3.11']
    title = 'Change .js mime to "text/javascript"'
    updated_at = <Date 2022-01-21.11:06:31.601>
    user = 'https://github.com/MylesBorins'

    bugs.python.org fields:

    activity = <Date 2022-01-21.11:06:31.601>
    actor = 'arhadthedev'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2018-10-02.22:28:39.501>
    creator = 'mylesborins'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34875
    keywords = ['patch']
    message_count = 7.0
    messages = ['326920', '326923', '327006', '327007', '327010', '345883', '411109']
    nosy_count = 5.0
    nosy_names = ['asvetlov', 'ammar2', 'mylesborins', 'wangjiahua', 'arhadthedev']
    pr_nums = ['9678', '30740']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34875'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    Activity

    1. MylesBorins commented on Oct 2, 2018

      MylesBorinsmannequin
      MannequinAuthor

      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

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Oct 2, 2018
    3. ammaraskar commented on Oct 2, 2018

      @ammaraskar
      Member

      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

    4. changed the title [-]Change .js mime to "test/javascript"[/-] [+]Change .js mime to "text/javascript"[/+] on Oct 3, 2018
    5. asvetlov commented on Oct 3, 2018

      @asvetlov
      Contributor

      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.

    6. MylesBorins commented on Oct 3, 2018

      MylesBorinsmannequin
      MannequinAuthor

      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/

    7. asvetlov commented on Oct 3, 2018

      @asvetlov
      Contributor

      We can return to the question when (and if) the draft will be accepted.

    8. MylesBorins commented on Jun 17, 2019

      MylesBorinsmannequin
      MannequinAuthor

      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/

    9. arhadthedev commented on Jan 21, 2022

      @arhadthedev
      Member

      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.

    10. transferred this issue fromon Apr 10, 2022
    11. mathiasbynens commented on May 10, 2022

      @mathiasbynens

      Following up to this old thread + this earlier discussion: RFC 9239 now unequivocally resolves this disagreement. Patch: #92627

    12. encukou commented on Mar 26, 2024

      @encukou
      Member

      This was reported later in #97646, and changed in #97934 (Python 3.12).

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of life3.11only security fixes3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-email

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions