Skip to content

Are multiple identical imports with different aliases possible / a goal? #526

@meastp

Description

@meastp

I came across the use case in the wasmCloud runtime linking docs.

Excerpt:

For example, a component may use the wasi:keyvalue interface to link to both a local key-value cache for ephemeral storage and a cloud-based store for more resilient storage.
In this example, you're using the same key-value interface and the same operations, but the interface needs to be configured differently. These different configurations of the interface can be differentiated with a link name.

Wouldn't this be better standardized as native component model functionality, avoiding different vendor solutions?
Perhaps by giving imports names or aliases somehow? One must be able to determine which storage import (local or cloud-based) is used in the language bindings/source code.

Using the LEGO brick terminology which is popular for illustrating wasm component imports/exports: when giving imports names or aliases, each aliased import get its own tube/socket that must be filled separately.

Did this make sense? Perhaps it could be done another way, but I think solving the use case in wit/wasm components is reasonable..?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions