Obtaining deferred namespace imports

Aperta
#119 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
javascript, wasm
Ambito
api, compilers

Direzione di ricerca

Start by reading the linked TC39 deferred evaluation proposal and WebAssembly ESM integration issue 101, then compare the proposed namespace and deferred-namespace import conventions with the ESM integration semantics described here. Done means reaching an agreed convention and implementing support for obtaining the corresponding JavaScript module namespace objects.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The deferred evaluation proposal (https://github.com/tc39/proposal-defer-import-eval) is at Stage 3 in TC39 and starting to be implemented now.

We naturally support this in the ESM integration for deferring WebAssembly evaluation as already tracked in https://github.com/WebAssembly/esm-integration/issues/101, but what we do not support is obtaining access to deferred JS namespaces.

This means that WebAssembly cannot import other modules in a way that indicates their execution should be deferred, like JS will be able to do.

The reason for this is that WebAssembly has no way to get the JS module namespace object itself currently as it only imports named exports directly.

For the ESM integration only, the strawman proposal here is to support an import convention form that can be used to obtain the JS module namespace object:

(import "./mod.js" "wasm-js:namespace" (global $ns externref))
(import "./mod.js" "wasm-js:deferred-namespace" (global $ns externref))

In ECMA-262 this directly corresponds to the fact that ~namespace~ and ~deferred-namespace~ are already specified as being supported through the ResolveExport path on the module record, so that we are using the export name position for the convention is not purely a hack, but also matches the underlying specification semantics (see https://tc39.es/proposal-defer-import-eval/#abstract-resolveexport).

Lingua principale
WebAssembly
Stelle
458
Fork
40
Merge medio
10g 37m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebAssembly/esm-integration

Tutte le issue di WebAssembly/esm-integration

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.