Skip to content

Commit ade7bd8

Browse files
committed
docs(quickstart): drop http-export removal step, depends on wasmCloud#5278
Once wasmCloud/wasmCloud#5278 lands, the http-hello-world template no longer carries the redundant `export wasi:http/incoming-handler@0.2.2;` line in world.wit (wstd's #[http_server] macro handles it), so users never see the export and never have to think about removing it. Drop the [!code --] strikethrough and the :::note explainer from the Rust world.wit block — the persistent-storage step is now just "add two import lines." Also fix a stale link in the TypeScript tip box (was pointing at the Rust example by mistake). Signed-off-by: Eric Gregory <eric@cosmonic.com>
1 parent 3c7c21a commit ade7bd8

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

docs/quickstart/develop-a-webassembly-component.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,9 @@ world hello {
178178
import wasi:keyvalue/store@0.2.0-draft;
179179
// [!code ++]
180180
import wasi:keyvalue/atomics@0.2.0-draft;
181-
// [!code --]
182-
export wasi:http/incoming-handler@0.2.2;
183181
}
184182
```
185183

186-
:::note[Why drop the http export?]
187-
188-
Once `wit_bindgen::generate!` is in your source (added below), it generates bindings for every interface declared in `world.wit`. `wstd`'s `#[http_server]` proc macro ALSO generates the `wasi:http/incoming-handler` export &mdash; if both try to define it, the component encoder fails with *"failed to find export of interface `wasi:http/incoming-handler@…` function `handle`."* Removing the export from `world.wit` leaves `wstd` solely responsible for it, which is the pattern the [`http-hello-world-persistent-storage`](https://github.com/wasmCloud/wasmCloud/tree/main/examples/http-hello-world-persistent-storage) example uses.
189-
190-
:::
191-
192184
</TabItem>
193185
<TabItem value="typescript" label="TypeScript">
194186

@@ -312,7 +304,7 @@ We've made changes, so once we save, the toolchain will once again automatically
312304

313305
:::tip[See the working version]
314306

315-
The end-state Rust component for this section lives at [`examples/http-hello-world-persistent-storage`](https://github.com/wasmCloud/wasmCloud/tree/main/examples/http-hello-world-persistent-storage) in the main wasmCloud repo. CI builds it on every PR, so any drift between this walkthrough and what actually compiles surfaces immediately.
307+
You can find the end-state Rust component for this section [in the main wasmCloud repo](https://github.com/wasmCloud/wasmCloud/tree/main/examples/http-hello-world-persistent-storage).
316308

317309
:::
318310

@@ -355,7 +347,7 @@ We've made changes, so once we save, the toolchain will once again automatically
355347

356348
:::tip[See the working version]
357349

358-
The end-state TypeScript component for this section lives at [`examples/components/http-hello-world-hono-persistent-storage`](https://github.com/wasmCloud/typescript/tree/main/examples/components/http-hello-world-hono-persistent-storage) in the `wasmCloud/typescript` repo. CI builds it on every PR, so any drift between this walkthrough and what actually compiles surfaces immediately.
350+
You can find the end-state TypeScript component for this section [in the `wasmCloud/typescript` repo](https://github.com/wasmCloud/typescript/tree/main/examples/components/http-hello-world-hono-persistent-storage).
359351

360352
:::
361353

0 commit comments

Comments
 (0)