You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a wide base of ECMAScript runtime environments being used beyond web browsers, specifically in web server and edge platforms. An major benefit to this approach is the ability to use a single programming language across multiple contexts, reducing specialization and allowing for reuse of code across the server and client side.
20
+
There is a wide base of ECMAScript runtime environments being used beyond web browsers, specifically in web server and edge platforms. A major benefit to this approach is the ability to use a single programming language across multiple contexts, reducing specialization and allowing for reuse of code across the server and client side.
21
21
22
22
Since code running in web browsers makes up the vast majority of ECMAScript code, runtimes are incentivised to support the same APIs as web browsers. However without a specification of which web platform APIs to be implemented, the resulting landscape provides poor interoperability across such environments.
23
23
@@ -70,11 +70,11 @@ This Standard defines the 2025 snapshot of the Minimum common web API, a curated
70
70
Conformance {#conformance}
71
71
==========================
72
72
73
-
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 Standard, according to their definition in the corresponding W3C or WHATWG standard.
73
+
A conforming implementation of this Standard shall provide the interfaces and properties listed in this specification, according to their definition in the corresponding W3C or WHATWG standard. A conforming implementation shall also conform to ECMA-262.
74
74
75
-
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.
75
+
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. Extending API surface, even without modifying existing API behaviours, should be avoided as it can reduce interoperability and portability of code across runtimes.
76
76
77
-
This Standard does not prohibit implementing additional Web Platform APIs beyond those listed here.
77
+
Runtimes may implement Web Platform APIs beyond those listed in this Standard.
78
78
79
79
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.
80
80
@@ -96,14 +96,14 @@ The Web Platform is the combination of technology standards defined by organizat
Any ECMAScript-based application runtime environment that implements the subset of Web Platform APIs outlined in this Standard.
99
+
Any ECMAScript-based runtime environment that implements this Standard. Web Browsers provide a Web-interoperable Runtime.
100
100
101
-
While this term is intentionally broad to also encompass Web Browsers, the primary focus here is on outlining expectations for non-browser runtimes.
101
+
The term "Web-interoperable Runtime" is intentionally broad. The primary focus of this Standard is web server runtimes.
102
102
103
103
Common API Index {#api-index}
104
104
=========================
105
105
106
-
All <a>Web-interoperable Runtimes</a> conforming to this Standard shall implement each of the following <a>Web Platform</a> 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.
106
+
All <a>Web-interoperable Runtimes</a> conforming to this Standard shall implement each of the following <a>Web Platform</a> APIs. These should be implemented in accordance with their normative requirements except where modified here. Where any runtime environment must diverge from a normative requirement for technical or structural reasons, clear documentation shall be provided. Documentation shall include both explanation and impact of deviation.
107
107
108
108
All of the following interfaces shall be exposed on the global object accessible through `globalThis`, unless otherwise specified in this Standard:
109
109
@@ -189,7 +189,7 @@ All of the following methods and properties shall be exposed on the global objec
Web-interoperable runtimes that support workers shall also expose {{WorkerGlobalScope/onerror}},
192
+
If web-interoperable runtimes support workers, they shall also expose {{WorkerGlobalScope/onerror}},
193
193
{{WorkerGlobalScope/onunhandledrejection}}, {{WorkerGlobalScope/onrejectionhandled}} and
194
194
{{WorkerGlobalScope/self}} on the worker's `globalThis`,
195
195
unless otherwise specified in this Standard. [[!HTML]]
@@ -199,7 +199,7 @@ The Global Scope {#global-scope}
199
199
200
200
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 Standard shall be exposed on the runtime's relevant global scope (e.g., `globalThis.crypto`, `globalThis.ReadableStream`, etc).
201
201
202
-
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 Standard 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.
202
+
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 Standard may omit 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.
203
203
204
204
The global object on {{Window}}-like and worker environments should always be an instance of {{EventTarget}}. Web-interoperable runtimes should follow the <a>report an exception</a> algorithm, and the JavaScript <a href="https://tc39.es/ecma262/#sec-host-promise-rejection-tracker">HostPromiseRejectionTracker</a> host hook, as defined in [[!HTML]]. This includes firing the {{Window/error}}, {{Window/unhandledrejection}} and {{Window/rejectionhandled}} events on the global object.
205
205
@@ -218,6 +218,6 @@ The [=default `User-Agent` value=] is provided such that application code can re
218
218
product-version = token
219
219
</pre>
220
220
221
-
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.
221
+
The [=default `User-Agent` value=] should be treated by application code 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.
222
222
223
223
Note: For instance, `navigator.userAgent` could be set to `'MyRuntime'`.
0 commit comments