bytecodealliance / bytecodealliance/ComponentizeJS

Semver aware WASI module resolution when dealing with imports

Aberta
#349 0 comentários 0 reações 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
Rust
Estrelas
391
Forks
53
Merge médio
3d 5h
PRs com merge (30d)
1

Descrição

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).

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Comece pelo caminho de resolução de imports WASI do ComponentizeJS e rastreie o tratamento existente de correspondências diretas para imports como wasi:http/types@0.2.6. Defina o comportamento semver compatível para correspondências exatas, atualizações dentro da linha WASI 2.x suportada e rejeição de versões mais antigas incompatíveis. A tarefa estará concluída quando o import indicado for resolvido com base em worlds compatíveis mais novos, enquanto jco transpile permanece fora do escopo.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
javascript, rust, wasm
Domínio
compilers, developer-experience
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
56/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.