Semver aware WASI module resolution when dealing with imports

Abierto
#349 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
56/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, rust, wasm

Línea de trabajo

Comienza en la ruta de resolución de imports de WASI de ComponentizeJS y sigue el manejo existente de coincidencias directas para imports como wasi:http/[email protected]. Define el comportamiento semver compatible para coincidencias exactas, actualizaciones dentro de la línea WASI 2.x compatible y el rechazo de versiones anteriores incompatibles. La tarea estará terminada cuando el import indicado se resuelva contra worlds compatibles más nuevos, mientras que jco transpile queda fuera del alcance.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

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:

import { Fields } from "wasi:http/[email protected]";

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

Lenguaje dominante
Rust
Estrellas
404
Forks
61
Merge medio
21 h 21 min
PR fusionados (30 d)
3

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bytecodealliance/ComponentizeJS

Todos los issues de bytecodealliance/ComponentizeJS

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.