`use` for `implements` interface

Aberta
#768 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 4 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
12/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
wasm
Domínio
api

Direção de pesquisa

The reproduction is the WIT example in the issue: an implements rename of response leaves wrapped-response.request pointing at the imported types.request instead of wrapped-types.request. Start by working out whether the spec defines implements to rewrite use-referenced types, and by checking the component-model specification text on use and implements. Done means a maintainer decision on the intended semantics, and possibly a proposed syntax such as with { types: wrapped-types }. This is spec design work, not a first-time code change.

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

Descrição

Consider this WIT file, where I want to virtualize response into wrapped-response.

interface types {
  resource request;
}
interface response {
  use types.{request};
  send: func(r: request) -> request;
}

world w {
  import types;
  import response;
  export wrapped-types: types;
  export wrapped-response: response;
}

The implements rename only happen at the surface level: wrapped-response.request still points to the imported types.request, not wrapped-types.request, which means request cannot be virtualized with just implements.

I can manually duplicate the interfaces and rename them, and not using the implements feature. Just wondering if implements is supposed to work with this kind of virtualization use case. If so, maybe we want to extend the syntax to something like export wrapped-response: response with { types: wrapped-types }.

Another limitation is that we can't write use wrapped-types.{request} in WIT, because wrapped-types is a label, so there is no way to refer to the virtualized wrapped-types.{request} by hand either.

Linguagem predominante
WebAssembly
Estrelas
1.4k
Forks
134
Merge médio
3d 19h
PRs com merge (30d)
8

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de WebAssembly/component-model

Todas as issues de WebAssembly/component-model

Issues semelhantes

Mais issues de Backend & API Design

Receba novas issues na sua caixa de entrada

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