Skip to content

Commit

Permalink
wasm-compose: implement a new CompositionGraph API.
Browse files Browse the repository at this point in the history
This commit implements a new `CompositionGraph` API that allows for building a
composition with more flexibility than what the `ComponentComposer` API
supports.

The `CompositionGraph` is geared towards live-editing of a composition graph.

This commit also reimplements `ComponentComposer` using the composition graph.

The previous instance graph and the encoding implementation for it have been
removed.
  • Loading branch information
peterhuene committed Nov 7, 2022
1 parent 3094923 commit 3d285bd
Show file tree
Hide file tree
Showing 27 changed files with 2,733 additions and 1,409 deletions.
6 changes: 3 additions & 3 deletions crates/wasm-compose/CONFIG.md
Expand Up @@ -72,7 +72,7 @@ An instantiation has the following fields:
arguments; argument names match the names of the imports of the dependency being
instantiated.

Note that the instantiation name `$component` is special and signifies how the input
Note that the instantiation name `$input` is special and signifies how the input
component is to be instantiated.

### Instantiation arguments
Expand All @@ -97,7 +97,7 @@ A slightly complex example of configuring instantiations:

```yaml
instantiations:
$component:
$input:
arguments:
a: b
b:
Expand All @@ -109,7 +109,7 @@ instantiations:
dependency: f
```

In the above example, the `$component` instantiation (i.e. the root instantiation) has explicitly
In the above example, the `$input` instantiation (i.e. the root instantiation) has explicitly
specified that the argument named `a` is to be provided instance `b`.

It also defines an instantiation named `b` which is to be passed an instance export named `e`
Expand Down
1 change: 1 addition & 0 deletions crates/wasm-compose/Cargo.toml
Expand Up @@ -21,6 +21,7 @@ petgraph = "0.6.2"
log = { workspace = true }
serde_yaml = "0.8.26"
clap = { workspace = true, optional = true }
smallvec = "1.10.0"

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion crates/wasm-compose/example/server/config.yml
Expand Up @@ -2,6 +2,6 @@ search-paths:
- ../service/target/wasm32-unknown-unknown/release

instantiations:
$component:
$input:
arguments:
backend: svc

0 comments on commit 3d285bd

Please sign in to comment.