Skip to content

Commit 27841d9

Browse files
authored
Additional refinements to initial draft (#1)
1 parent 35650e7 commit 27841d9

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

index.bs

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,30 @@ Markup Shorthands: markdown yes
1010
</pre>
1111
<pre class=link-defaults>
1212
spec:url; type:interface; text:URL
13-
spec:html; type:attribute; for:WorkerGlobalScope; text:navigator
13+
spec:html; type:attribute; for:Window; text:navigator
14+
spec:html; type:attribute; for:Window; text:self
1415
</pre>
1516

1617
Introduction {#intro}
1718
=====================
1819

1920
*This section is non-normative.*
2021

21-
TBD
22-
23-
Use Cases {#use-cases}
24-
======================
25-
26-
*This section is non-normative.*
27-
28-
TBD
22+
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.
2923

3024
Terminology {#terminology}
3125
==========================
3226

33-
TBD
27+
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.
28+
29+
A Web Platform API is a ... TBD.
30+
31+
A <dfn>Web-interoperable Runtime</dfn> is any EcmaScript-based application runtime environment that implements the subset of Web Platform APIs outlined in this specification. This term is intentionally broad to also encompass Web Browsers.
3432

3533
Common API Index {#index}
3634
=========================
3735

38-
All runtime environments purporting to conform to this specification SHALL fully implement each of
39-
the following Web Platform APIs in accordance to their normative standard definitions as
40-
referenced. Where any conforming runtime environment chooses (either by necessity or otherwise) to
41-
diverge from a normative requirement of the specification, clear explanations of such divergence
42-
MUST be made readily available in documentation.
36+
All <a>Web-interoperable Runtimes</a> conforming to this specification SHALL fully implement each of the following Web Platform APIs in accordance to their normative standard 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 documentation.
4337

4438
Interfaces:
4539

@@ -76,11 +70,38 @@ Interfaces:
7670
Global methods / properties:
7771

7872
* <code class="idl"><a data-link-type="idl" href="https://tc39.es/ecma262/multipage/global-object.html#sec-globalthis">globalThis</a></code>
73+
* globalThis.{{self}}
7974
* globalThis.{{atob()}}
8075
* globalThis.{{btoa()}}
8176
* globalThis.{{console}}
77+
* globalThis.{{crypto}}
8278
* globalThis.{{navigator}}.{{userAgent}}
8379
* globalThis.{{queueMicrotask()}}
8480
* globalThis.{{setTimeout()}} / globalThis.{{clearTimeout()}}
8581
* globalThis.{{setInterval()}} / globalThis.{{clearInterval()}}
8682
* globalThis.{{structuredClone()}}
83+
84+
The Global Scope {#global-scope}
85+
================================
86+
87+
The exact type of the `globalScope` can vary across runtimes. Most Web Platform APIs are defined in terms that assume Web Browser environments that specifically expose types like {{Window}}, {{Worker}}, {{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).
88+
89+
Likewise, 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 defined global properties using the `readonly` attribute. 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.
90+
91+
Extensions {#extensions}
92+
========================
93+
94+
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.
95+
96+
Application use of such extensions must be carefully considered, as doing so reduces interoperability and portability of code across runtimes.
97+
98+
Open Questions {#open-questions}
99+
================================
100+
101+
*Remove this section before publishing.*
102+
103+
Issue: Should `window` also be included here as an alias for `globalThis`?
104+
105+
Issue: Should `globalThis` be required to extend from `EventTarget`?
106+
107+
Issue: Many of the globals defined as Web Platform APIs are marked as `readonly` on the global scope. This, however, causes a number of backwards compatibility issues in many runtimes whenever a new global is added (this has been a challenge in Node.js and Cloudflare Workers, for instance). We likely need to allow for standard globals to be implemented without the `readonly` attribute enforced.

0 commit comments

Comments
 (0)