From 2c3b89294784b833928bc36175e244c13cdaa650 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 6 Oct 2025 18:24:57 +0200 Subject: [PATCH 1/6] Update spec to match Ecma template --- index.bs | 59 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/index.bs b/index.bs index 42be8e2..01b7f7a 100644 --- a/index.bs +++ b/index.bs @@ -15,26 +15,57 @@ spec:html; type:attribute; for:Window; text:navigator spec:fetch; type:method; text:fetch() -Introduction {#intro} -===================== +

Introduction

-*This section is non-normative.* +There is a wide base of JavaScript runtime environments being used beyond web browsers, specifically in web server and edge platforms. An important part of the reason for this is the fact that JavaScript can be used both in the server and in the client side, which reduces the specialization needed to work in different parts of a single codebase, and allows reusing code across the server and client side. -The Minimum Common Web Platform API is a curated subset of standardized Web Platform APIs intended to define a minimum set of capabilities common to Browser and Non-Browser JavaScript-based runtime environments. +But since code running in web browsers makes up the vast majority of JavaScript code, this is helped along if such runtimes support the same APIs as web browsers. So, unsurprisingly, more and more runtime environments have started supporting web platform APIs. However, the increase in such environments, as well as the different choices of web platform APIs, resulted in poor interoperability across such environments. -Terminology {#terminology} +As such, this Ecma Standard defines the Minimum Common Web API specification, which lists a curated minimum subset of web platform APIs for server-side and edge runtimes to implement if they aim to be web-interoperable. This is the first edition of the standard, corresponding to the 2026 snapshot, and an additional snapshot will be published every year. + +Scope {#scope} +============== + +This Standard defines the 2026 snapshot of the Minimum Common Web Platform API, a curated subset of APIs defined by web platform standards from W3C and WHATWG, which is intended to define a minimum set of capabilities common to Browser and Non-Browser JavaScript-based runtime environments. + +Conformance {#conformance} ========================== -The Web Platform is the combination of technology standards defined by organizations such as the W3C, the WHATWG, and others as implemented by Web Browsers. +A conforming implementation of the Minimum Common Web Platform API MUST conform to ECMA-262, and additionally MUST provide the interfaces and properties listed in this specification, according to their definition in the corresponding W3C or WHATWG standard. -A Web-interoperable Runtime is any ECMAScript-based application runtime environment that implements the subset of Web Platform APIs outlined in this specification. -While this term is intentionally broad to also encompass Web Browsers, the primary focus here is on outlining expectations for non-browser runtimes. +Runtime-specific extensions to any Web Platform API MAY be implemented by conforming runtimes. Such extensions MUST be defined so that their use neither contradicts, nor causes the non-conformance of, normative functionality of any Web Platform API. It is important to carefully consider use of such extensions, as it reduces interoperability and portability of code across runtimes. + +This specification does not prohibit implementing additional Web Platform APIs beyond those listed here. + +Note: For example, the {{Performance}} API could be extended with additional methods or properties beyond those defined in the [[HR-TIME]] specifications, such as those defined in the [[PERFORMANCE-TIMELINE]] or [[USER-TIMING]] specifications. 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]]. +Normative references {#TODO} +============================ + +The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. + +
+ +Terms and definitions {#terminology} +==================================== + +Web Platform {#term-web-platform} +-------------------------------------------- + +The Web Platform is the combination of technology standards defined by organizations such as the W3C, the WHATWG, and others as implemented by Web Browsers. + +Web-interoperable Runtime {#term-web-interoperable-runtime} +---------------------------------------------------------------------- + +Any ECMAScript-based application runtime environment that implements the subset of Web Platform APIs outlined in this specification. + +While this term is intentionally broad to also encompass Web Browsers, the primary focus here is on outlining expectations for non-browser runtimes. + Common API Index {#api-index} ========================= @@ -156,15 +187,3 @@ The [=default `User-Agent` value=] is provided such that application code can re The [=default `User-Agent` value=] SHOULD be treated as a single, complete, opaque, unstructured value. It is RECOMMENDED that the value be limited to a single `product` token excluding the optional `product-version`. The value SHOULD NOT include any `comment` components. Note: For instance, `navigator.userAgent` could be set to `'MyRuntime'`. - -Extensions {#extensions} -======================== - -Runtime-specific extensions to any Web Platform API MAY be implemented by conforming runtimes. Such extensions MUST be defined so that their use neither contradicts, nor causes the non-conformance of, normative functionality of any Web Platform API. - -It is important to carefully consider use of such extensions, as it reduces interoperability and portability of code across runtimes. - -This specification does not prohibit implementing additional Web Platform APIs beyond those listed here. - -Note: For example, the {{Performance}} API could be extended with additional methods or properties beyond those defined in the [[HR-TIME]] specifications, such as those defined in the [[PERFORMANCE-TIMELINE]] or [[USER-TIMING]] specifications. - From 1b83b43eb970925ee1214088c4d4dbb531b2d7ab Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 6 Oct 2025 18:35:01 +0200 Subject: [PATCH 2/6] fix: 2025 snapshot --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 01b7f7a..b7c9581 100644 --- a/index.bs +++ b/index.bs @@ -21,12 +21,12 @@ There is a wide base of JavaScript runtime environments being used beyond web br But since code running in web browsers makes up the vast majority of JavaScript code, this is helped along if such runtimes support the same APIs as web browsers. So, unsurprisingly, more and more runtime environments have started supporting web platform APIs. However, the increase in such environments, as well as the different choices of web platform APIs, resulted in poor interoperability across such environments. -As such, this Ecma Standard defines the Minimum Common Web API specification, which lists a curated minimum subset of web platform APIs for server-side and edge runtimes to implement if they aim to be web-interoperable. This is the first edition of the standard, corresponding to the 2026 snapshot, and an additional snapshot will be published every year. +As such, this Ecma Standard defines the Minimum Common Web API specification, which lists a curated minimum subset of web platform APIs for server-side and edge runtimes to implement if they aim to be web-interoperable. This is the first edition of the standard, corresponding to the 2025 snapshot, and an additional snapshot will be published every year. Scope {#scope} ============== -This Standard defines the 2026 snapshot of the Minimum Common Web Platform API, a curated subset of APIs defined by web platform standards from W3C and WHATWG, which is intended to define a minimum set of capabilities common to Browser and Non-Browser JavaScript-based runtime environments. +This Standard defines the 2025 snapshot of the Minimum Common Web Platform API, a curated subset of APIs defined by web platform standards from W3C and WHATWG, which is intended to define a minimum set of capabilities common to Browser and Non-Browser JavaScript-based runtime environments. Conformance {#conformance} ========================== From 2d474040d77f63449252e423d514f8ce38496a14 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 6 Oct 2025 18:45:29 +0200 Subject: [PATCH 3/6] Update index.bs Co-authored-by: Aki --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index b7c9581..ab126f8 100644 --- a/index.bs +++ b/index.bs @@ -31,7 +31,7 @@ This Standard defines the 2025 snapshot of the Minimum Common Web Platform API, Conformance {#conformance} ========================== -A conforming implementation of the Minimum Common Web Platform API MUST conform to ECMA-262, and additionally MUST provide the interfaces and properties listed in this specification, according to their definition in the corresponding W3C or WHATWG standard. +A conforming implementation of the Minimum Common Web Platform API shall conform to ECMA-262, and additionally shall provide the interfaces and properties listed in this specification, according to their definition in the corresponding W3C or WHATWG standard. Runtime-specific extensions to any Web Platform API MAY be implemented by conforming runtimes. Such extensions MUST be defined so that their use neither contradicts, nor causes the non-conformance of, normative functionality of any Web Platform API. It is important to carefully consider use of such extensions, as it reduces interoperability and portability of code across runtimes. From 54dfa9bf84cc0260e0261dac04e38c684816de4b Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 6 Oct 2025 18:45:36 +0200 Subject: [PATCH 4/6] Update index.bs Co-authored-by: Aki --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index ab126f8..6dfcc16 100644 --- a/index.bs +++ b/index.bs @@ -33,7 +33,7 @@ Conformance {#conformance} A conforming implementation of the Minimum Common Web Platform API shall conform to ECMA-262, and additionally shall provide the interfaces and properties listed in this specification, according to their definition in the corresponding W3C or WHATWG standard. -Runtime-specific extensions to any Web Platform API MAY be implemented by conforming runtimes. Such extensions MUST be defined so that their use neither contradicts, nor causes the non-conformance of, normative functionality of any Web Platform API. It is important to carefully consider use of such extensions, as it reduces interoperability and portability of code across runtimes. +Runtime-specific extensions to any Web Platform API may be implemented by conforming runtimes. Such extensions shall be defined so that their use neither contradicts, nor causes the non-conformance of, normative functionality of any Web Platform API. It is important to carefully consider use of such extensions, as it reduces interoperability and portability of code across runtimes. This specification does not prohibit implementing additional Web Platform APIs beyond those listed here. From af0e21b92bd94706f417f3d827b918352f3d367a Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 6 Oct 2025 18:46:16 +0200 Subject: [PATCH 5/6] Remove RFC2119 reference --- index.bs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/index.bs b/index.bs index 6dfcc16..c790330 100644 --- a/index.bs +++ b/index.bs @@ -39,11 +39,6 @@ This specification does not prohibit implementing additional Web Platform APIs b Note: For example, the {{Performance}} API could be extended with additional methods or properties beyond those defined in the [[HR-TIME]] specifications, such as those defined in the [[PERFORMANCE-TIMELINE]] or [[USER-TIMING]] specifications. -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]]. - Normative references {#TODO} ============================ From b9da5642b146f49f477ec99f549d58487f008394 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Mon, 6 Oct 2025 18:54:04 +0200 Subject: [PATCH 6/6] Use 'shall' and lowercase RFC2119 keywords --- index.bs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.bs b/index.bs index c790330..f07c326 100644 --- a/index.bs +++ b/index.bs @@ -64,9 +64,9 @@ While this term is intentionally broad to also encompass Web Browsers, the prima Common API Index {#api-index} ========================= -All Web-interoperable Runtimes conforming to this specification MUST implement each of the following Web Platform APIs. These SHOULD be implemented in accordance with their normative requirements except where modified here. Where any conforming runtime environment chooses (either by necessity or otherwise) to diverge from a normative requirement of the specification, clear explanations of such divergence MUST be made clearly and readily available in the documentation. +All Web-interoperable Runtimes conforming to this specification shall implement each of the following Web Platform APIs. These should be implemented in accordance with their normative requirements except where modified here. Where any conforming runtime environment chooses (either by necessity or otherwise) to diverge from a normative requirement of the specification, clear explanations of such divergence shall be made clearly and readily available in the documentation. -All of the following interfaces MUST be exposed on the global object accessible through `globalThis`, unless otherwise specified in this specification: +All of the following interfaces shall be exposed on the global object accessible through `globalThis`, unless otherwise specified in this specification: * {{AbortController}} [[!DOM]] * {{AbortSignal}} [[!DOM]] @@ -122,7 +122,7 @@ All of the following interfaces MUST be exposed on the global object accessible * {{WritableStreamDefaultController}} [[!STREAMS]] * {{WritableStreamDefaultWriter}} [[!STREAMS]] -All of the following methods and properties MUST be exposed on the global object accessible through `globalThis`, unless otherwise specified in this specification: +All of the following methods and properties shall be exposed on the global object accessible through `globalThis`, unless otherwise specified in this specification: * {{globalThis}} [[!ECMASCRIPT]] * `globalThis.`{{atob()}} [[!HTML]] @@ -150,7 +150,7 @@ All of the following methods and properties MUST be exposed on the global object * `globalThis.`{{WebAssembly}}.{{WebAssembly/JSTag}} [[!WASM-JS-API-2]] * `globalThis.`{{WebAssembly}}.{{WebAssembly/validate()}} [[!WASM-JS-API-2]] -Web-interoperable runtimes that support workers MUST also expose {{WorkerGlobalScope/onerror}}, +Web-interoperable runtimes that support workers shall also expose {{WorkerGlobalScope/onerror}}, {{WorkerGlobalScope/onunhandledrejection}}, {{WorkerGlobalScope/onrejectionhandled}} and {{WorkerGlobalScope/self}} on the worker's `globalThis`, unless otherwise specified in this specification. [[!HTML]] @@ -158,20 +158,20 @@ unless otherwise specified in this specification. [[!HTML]] The Global Scope {#global-scope} ================================ -The exact type of the global scope (`globalThis`) can vary across runtimes. Most Web Platform APIs are defined in terms that assume Web Browser environments that specifically expose types like {{Window}}, {{WorkerGlobalScope}}, and so forth. To simplify conformance, all interfaces, methods, and properties defined by this specification MUST be exposed on the runtime's relevant global scope (e.g., `globalThis.crypto`, `globalThis.ReadableStream`, etc). +The exact type of the global scope (`globalThis`) can vary across runtimes. Most Web Platform APIs are defined in terms that assume Web Browser environments that specifically expose types like {{Window}}, {{WorkerGlobalScope}}, and so forth. To simplify conformance, all interfaces, methods, and properties defined by this specification shall be exposed on the runtime's relevant global scope (e.g., `globalThis.crypto`, `globalThis.ReadableStream`, etc). -With many runtimes, adding a new global-scoped property can introduce breaking changes when the new global conflicts with existing application code. Many Web Platform APIs define global properties using [=read only|the `readonly` attribute=]. [[!WEBIDL]] To avoid introducing breaking changes, runtimes conforming to this specification MAY choose to ignore the `readonly` attribute for properties being added to the global scope. This allows users of these runtimes to delete or overwrite these properties if they conflict with existing application code. +With many runtimes, adding a new global-scoped property can introduce breaking changes when the new global conflicts with existing application code. Many Web Platform APIs define global properties using [=read only|the `readonly` attribute=]. [[!WEBIDL]] To avoid introducing breaking changes, runtimes conforming to this specification may choose to ignore the `readonly` attribute for properties being added to the global scope. This allows users of these runtimes to delete or overwrite these properties if they conflict with existing application code. -The global object on {{Window}}-like and worker environments SHOULD always be an instance of {{EventTarget}}. Web-interoperable runtimes SHOULD follow the report an exception algorithm, and the JavaScript HostPromiseRejectionTracker host hook, as defined in [[!HTML]]. This includes firing the {{Window/error}}, {{Window/unhandledrejection}} and {{Window/rejectionhandled}} events on the global object. +The global object on {{Window}}-like and worker environments should always be an instance of {{EventTarget}}. Web-interoperable runtimes should follow the report an exception algorithm, and the JavaScript HostPromiseRejectionTracker host hook, as defined in [[!HTML]]. This includes firing the {{Window/error}}, {{Window/unhandledrejection}} and {{Window/rejectionhandled}} events on the global object. -In cases where it is not possible to have the global object be an instance of {{EventTarget}} due to legacy reasons, the relevant events MUST still be fired through a suitable alternative mechanism available at the global scope. This mechanism MUST provide at least the same information that is provided by the relevant event interfaces if the global object were to be an {{EventTarget}}. Such runtimes MUST NOT support the {{GlobalEventHandlers/onerror}}, {{WindowEventHandlers/onunhandledrejection}} and {{WindowEventHandlers/onrejectionhandled}} global properties. Such runtimes are not required to implement the {{ErrorEvent}} and {{PromiseRejectionEvent}} interfaces. +In cases where it is not possible to have the global object be an instance of {{EventTarget}} due to legacy reasons, the relevant events shall still be fired through a suitable alternative mechanism available at the global scope. This mechanism shall provide at least the same information that is provided by the relevant event interfaces if the global object were to be an {{EventTarget}}. Such runtimes shall not support the {{GlobalEventHandlers/onerror}}, {{WindowEventHandlers/onunhandledrejection}} and {{WindowEventHandlers/onrejectionhandled}} global properties. Such runtimes are not required to implement the {{ErrorEvent}} and {{PromiseRejectionEvent}} interfaces. Note: For example, in Node.js the global object does not implement {{EventTarget}}, and the relevant events are fired on the `globalThis.process` object with the names `uncaughtException`, `unhandledRejection` and `rejectionHandled`, respectively. Requirements for default User-Agent value {#useragent-requirements} ======================================================================== -The [=default `User-Agent` value=] is provided such that application code can reliably identify the runtime within which it is running. The value MUST be a string conforming to the `User-Agent` construction in [[!RFC7231]]: +The [=default `User-Agent` value=] is provided such that application code can reliably identify the runtime within which it is running. The value shall be a string conforming to the `User-Agent` construction in [[!RFC7231]]:
   User-Agent      = product *( RWS ( product / comment ) )
@@ -179,6 +179,6 @@ The [=default `User-Agent` value=] is provided such that application code can re
   product-version = token
 
-The [=default `User-Agent` value=] SHOULD be treated as a single, complete, opaque, unstructured value. It is RECOMMENDED that the value be limited to a single `product` token excluding the optional `product-version`. The value SHOULD NOT include any `comment` components. +The [=default `User-Agent` value=] should be treated as a single, complete, opaque, unstructured value. It is recommended that the value be limited to a single `product` token excluding the optional `product-version`. The value should not include any `comment` components. Note: For instance, `navigator.userAgent` could be set to `'MyRuntime'`.