DISPATCH B. Farias
Internet-Draft
Updates: 4329 (if approved) M. Miller
Intended status: Informational Mozilla
Expires: May 3, 2018 October 30, 2017

ECMAScript Media Types Updates
draft-ietf-dispatch-javascript-mjs-01

Abstract

This document proposes updates to the ECMAScript media types, superseding the existing registrations for “application/javascript” and “text/javascript” by adding an additional extension and removing usage warnings. This document updates RFC4329, “Scripting Media Types”.

Note to Readers

The issues list for this draft can be found at https://github.com/bmeck/I-D/labels/javascript-mjs.

The most recent (often, unpublished) draft is at https://github.com/bmeck/I-D/tree/master/javascript-mjs.

Recent changes are listed at https://github.com/bmeck/I-D/commits/master/javascript-mjs.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on May 3, 2018.

Copyright Notice

Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.


Table of Contents

1. Introduction

This document updates the existing media types for the ECMAScript programming language. It supersedes the media types registrations in [RFC4329] for “application/javascript” and “text/javascript”.

2. Background

In order to formalize support for modular programs [ECMA-262] now defines two top-level goal symbols for the ECMAScript grammar. This means that (in the absence of additional information) there are two possible interpretations for any given ECMAScript Source Text. The TC39 standards body for ECMAScript has determined that media types are outside of their scope of work [TC39-MIME-ISSUE].

It is not possible to fully determine if a Source Text of ECMAScript is meant to be parsed in the Module or Script grammar goals based upon content alone. Therefore, scripting environments must use out of band information in order to determine what goal a Source Text should be treated as. To this end some scripting environments have chosen to adopt a new file extension of .mjs for determining the goal of a given Source Text.

3. Notational Conventions

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119].

4. Registration

The ECMAScript media types are to be updated to point to a non-vendor specific standard undated specification of ECMAScript. In addition, a new file extension of .mjs is to be added to the list of file extensions with the restriction that it must correspond to the Module grammar of [ECMA-262]. Finally, the [HTML] specification is using text/javascript as the default media type of ECMAScript when preparing script tags; therefore, text/javascript has been moved intended usage from OBSOLETE to COMMON.

4.1. application/ecmascript

Type name:
application
Subtype name:
ecmascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.2. application/javascript

Type name:
application
Subtype name:
javascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>.

4.3. application/x-ecmascript

Type name:
application
Subtype name:
x-ecmascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.4. application/x-javascript

Type name:
application
Subtype name:
x-javascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.5. text/ecmascript

Type name:
text
Subtype name:
ecmascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.6. text/javascript

Type name:
text
Subtype name:
javascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
COMMON
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.7. text/javascript1.0

Type name:
text
Subtype name:
javascript1.0
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.8. text/javascript1.1

Type name:
text
Subtype name:
javascript1.1
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.9. text/javascript1.2

Type name:
text
Subtype name:
javascript1.2
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.10. text/javascript1.3

Type name:
text
Subtype name:
javascript1.3
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.11. text/javascript1.4

Type name:
text
Subtype name:
javascript1.4
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.12. text/javascript1.5

Type name:
text
Subtype name:
javascript1.5
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.13. text/jscript

Type name:
text
Subtype name:
jscript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.14. text/livescript

Type name:
text
Subtype name:
livescript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.15. text/x-ecmascript

Type name:
text
Subtype name:
x-ecmascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

4.16. text/x-javascript

Type name:
text
Subtype name:
x-javascript
Required parameters:
none
Optional parameters:
charset, see section 4.1 of [RFC4329].
goal, declares the goal symbol within [ECMA-262] to be used while parsing.
Encoding considerations:
Encoding is host dependent with differences in byte order marks, the charset parameter, and text preprocessing.
Security considerations:
See section 5 of [RFC4329].
Interoperability considerations:
See notes in various sections of [RFC4329]. This media type does not specify the grammar of [ECMA-262] used when missing the goal parameter.
Published specification:
[[RFCXXXX]]
Applications which use this media type:
Script interpreters as discussed in [RFC4329].
Additional information:
Magic number(s):
n/a
File extension(s):
.js, .mjs
Macintosh File Type Code(s):
TEXT

Person & email address to contact for further information:
See Author’s Address section.
Intended usage:
OBSOLETE
Restrictions on usage:
The file extension .mjs must be parsed using the Module grammar of [ECMA-262]
Author:
See Author’s Address section.
Change controller:
IESG <iesg@ietf.org>

5. References

5.1. Normative References

[ECMA-262] Ecma International, "Standard ECMA-262: ECMAScript Language Specification", August 2017.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[RFC3023] Murata, M., St. Laurent, S. and D. Kohn, "XML Media Types", RFC 3023, DOI 10.17487/RFC3023, January 2001.
[RFC4329] Hoehrmann, B., "Scripting Media Types", RFC 4329, DOI 10.17487/RFC4329, April 2006.

5.2. Informative References

[HTML] WHATWG, "HTML Living Standard", August 2017.
[TC39-MIME-ISSUE] TC39, "Add `application/javascript+module` mime to remove ambiguity5", August 2017.

Appendix A. Acknowledgements

Thanks to Suresh Krishnan, Alexey Melnikov, Mark Nottingham, James Snell, Matthew A. Miller, Adam Roach, and Allen Wirfs-Brock for guiding me through this process.

Authors' Addresses

Bradley Farias EMail: bradley.meck@gmail.com
Matthew A. Miller Mozilla EMail: linuxwolf+ietf@outer-planes.net