Skip to content

Commit

Permalink
fix: address llm feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Jun 6, 2024
1 parent 5212240 commit 90f6de8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions website/docs/guides/wasm-functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ In this guide, we'll see how to set up a workflow for using Rust for our custom

## Tooling

We'll first need to install a bunch of programs in order to be able to produce modern the requisite components. The following checklist contains links to get you started:
We need to install several programs to be able to produce the components.
The following checklist contains links to get you started:

1. Rust compiler toolchain: this guide assumes moderate familiartiy of development with rust and won't spend much words on how to get it functional. In any case, you can get started with rust [here](https://www.rust-lang.org/learn/get-started).
2. `wasm32-unknown-unknown` target for rustc: This is the backend for rustc uses to produce wasi compatible wasm components. If you're using `rustup` to manage your toolchain, Cargo will automatically install the target when you're building.
1. Rust compiler toolchain: this guide assumes moderate familiartiy of development with rust and won't spend many words on how to get it functional. In any case, you can get started with rust [here](https://www.rust-lang.org/learn/get-started).
2. `wasm32-unknown-unknown` target for rustc: This is the backend that rustc uses to produce wasi compatible wasm components. If you're using `rustup` to manage your toolchain, Cargo will automatically install the target when you're building.
3. `wasm-tools`: this is the swiss army knife for working with wasm artifacts, courtesy of the [Bytecode Alliance](https://bytecodealliance.org/). Installation instructions can be found [here](https://github.com/bytecodealliance/wasm-tools/).

## Typegraph
Expand Down Expand Up @@ -109,7 +110,8 @@ We'll modify it now to implement our custom function.
## Building

We'll now use the rust toolchain and wasm-tools to build the wasm component.
This require multiple commands so it's presented below as a shell script that you can modify from.
This requires multiple commands.
It's presented below as a shell script that you can modify from.

```bash
# flags to make script execution visible
Expand Down
4 changes: 2 additions & 2 deletions website/docs/reference/metagen/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ Metagen is availaible through the SDK for programmatic access needs and can be h

## Generators

:::info Chicken or egg?
:::info Chicken or the egg?
As most of the generators are intended for types to be used by custom functions, they'll require that you declare the custom functions in your typegraph first.
This begs the question, how does one declare custom functions that depend on artifacts that are yet to be generated?
Typegraphs error out when referenced artifacts aren't found, how does it work in this scenario?

To resolve this concern, the SDKs support a serialization mode that skips resolution of artifacts.
This mode is flipped on when serialization is done for codegen purposes.
This mode is activated when serialization is done for codegen purposes.
What this means is that, **you can declare non-existent files in your typegraph and codegen should work**.
Some generators are even smart enough to work around your expected files.
Of course, if the files aren't present when you're trying to deply to the typegate, it'll raise an error.
Expand Down

0 comments on commit 90f6de8

Please sign in to comment.