bytecodealliance / bytecodealliance/ComponentizeJS

Semver aware WASI module resolution when dealing with imports

Offen
#349 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Rust
Sterne
391
Forks
53
Ø Merge
3 T. 5 Std.
Gemergte PRs (30 T.)
1

Beschreibung

Right now when building components with ComponentizeJS, we deal with references WASI types via direct match only.

This is usually fine but forces certain versions (the ones supported by StarlingMonkey below) to be used. Ideally we should be able to do an exact match where possible and the fall back to a compatible semver track (usually allowing upgrades but not downgrades) similar to what wasmtime would do.

As WASI 2.x is unlikely to change going forward I think we can now do this pretty definitively here, with minimal changes required for StarlingMonkey as well.

Also note that while this issue is probably going to be unnecessary when the "new" ComponentizeJS lands, this issue is here for tracking purposes just to make sure this

A simple use case is being able to write `wasi:http` components against any version of 2.x and having that compile (and eventually `jco transpile`, but that's out of scope here!) properly. Essentially the following should never fail:

```js
import { Fields } from "wasi:http/types@0.2.6";
```

(Even if the underlying world is 2.10/2.12, but this should fail if the underlying world is 2.4 probably)

Maybe it should be possible to disable this feature (i.e. supporting very specific imports), but IMO this would be a big DX improvement that is worth doing (maybe we emit some warnings or something if we're worried about it).

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start at ComponentizeJS's WASI import-resolution path and trace the existing direct-match handling for imports such as wasi:http/types@0.2.6. Define the compatible semver behavior around exact matches, upgrades within the supported WASI 2.x track, and rejection of incompatible older versions. Done means the stated import resolves against newer compatible worlds while jco transpile remains out of scope.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, rust, wasm
Bereich
compilers, developer-experience
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
56/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.