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
Copy file name to clipboardExpand all lines: proposals/esm-integration/README.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ function incrementCount() {
57
57
export {count, incrementCount};
58
58
```
59
59
60
-
WebAssembly modules currently can't take part in these graphs. This means that developers who want to use WebAssembly modules have to manually use the WebAssembly JS API. However, the API to compile and instantiate a WebAssembly module is asynchronous, so without [top-level await](https://github.com/tc39/proposal-top-level-await), it's not possible to export things which came out of WebAssembly module instantiation, in a way that's available to importers when the import completes.
60
+
WebAssembly modules currently can't take part in these graphs. This means that developers who want to use WebAssembly modules have to manually use the WebAssembly JS API. However, the recommended API to compile and instantiate a WebAssembly module is asynchronous, so without [top-level await](https://github.com/tc39/proposal-top-level-await), it's not possible to export things which came out of WebAssembly module instantiation, in a way that's available to importers when the import completes.
61
61
62
62
### Unify various WebAssembly module implementations
63
63
@@ -183,12 +183,6 @@ When a WebAssembly module imports a Global, there are two possible modes of oper
183
183
- If the Global type is immutable (as declared in the importing module), then the exporting module may either export a numeric value or an immutable Global.
184
184
- If the Global type is mutable, then the exporting module must export a mutable Global. The snapshot here is "shallow" in the sense that modifications *within* this particular mutable Global object *will* be visible in the importing module (but, if the exporting module overwrites the entire binding with some unrelated value, this will not be noticed by the importing module).
185
185
186
-
### Why does this proposal depend on top-level await?
187
-
188
-
On some platforms, some compilation work may need to happen when instantiating the module, rather than when parsing it, based on the dynamic values of the imports. For example, if a module imports Memory, there may be different instructions generated for different kinds of memory, with the choice made based on what's dynamically available.
189
-
190
-
Instantiating a WebAssembly module may take a significant amount of time, as it may involve expensive compilation work. For this reason, at some point during evaluation of a WebAssembly module, control is yielded to the event loop, to not block up the main thread. This yield uses the infrastructure of [the TC39 top-level await proposal](https://github.com/tc39/proposal-top-level-await).
191
-
192
186
### Can Web APIs be imported via modules?
193
187
194
188
In general, Web APIs are exposed through properties of the JavaScript global object, and are not available through ES Modules. See [this WebIDL](https://github.com/heycam/webidl/issues/676) issue for some early discussion about exposing Web APIs through modules.
0 commit comments