docs(quickstart): fix persistent-storage step + link to merged examples#1205
Open
ericgregory wants to merge 4 commits into
Open
docs(quickstart): fix persistent-storage step + link to merged examples#1205ericgregory wants to merge 4 commits into
ericgregory wants to merge 4 commits into
Conversation
Three issues surfaced while building the working examples (wasmCloud #5276 and typescript wasmCloud#678) that the quickstart prose walks users through; this catches the docs up to what actually compiles. - Rust world.wit: drop `export wasi:http/incoming-handler@0.2.9;` with a [!code --] strikethrough marker. wstd's #[http_server] macro generates the http export internally; leaving it in world.wit while also calling wit_bindgen::generate! makes the component encoder fail (the macro and the manual binding generation race over the same export symbol). Add a :::note explaining why, since this is the kind of detail a first-time user wouldn't infer from the error. - TS world.wit: revert lingering 0.2.9 → 0.2.6 in the persistent- storage section. PR wasmCloud#1204 fixed the earlier code block but missed this one; jco-std 0.1.x ships only the 0.2.6 adapter, so anything else trips the same ReferenceError already documented in bytecodealliance/jco#1245. - Rust src/lib.rs: `atomics::increment(&bucket, &name, 1)` → `atomics::increment(&bucket, name, 1)`. `name` is already `&str` from the query parsing; passing `&name` makes it `&&str` and clippy's needless_borrow lint (which the wasmCloud workspace denies) rejects the build. Plus, link each language's section to its CI-tested example: - Rust → wasmCloud/wasmCloud/examples/http-hello-world-persistent-storage - TS → wasmCloud/typescript/examples/components/http-hello-world-hono-persistent-storage The companion examples were added in wasmCloud/wasmCloud#5272 and wasmCloud/typescript#668 (both merged); the standard `examples` workflows on those repos rebuild them on every PR, so future drift between this walkthrough and what actually compiles surfaces in CI. Signed-off-by: Eric Gregory <eric@cosmonic.com>
✅ Deploy Preview for dreamy-golick-5f201e ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Surfaced while validating the persistent-storage walkthrough end to end: the not_found function shown in the Rust code block uses `.unwrap()` (no [!code] markers, so it's meant to be unchanged context), but the template scaffolds with `.map_err(Into::into)` and the workspace lints set `unwrap_used = 'deny'`. `wash build` (cargo build) passes the docs version, but `cargo clippy` rejects it — and the docs-linked example also uses the .map_err form. Restoring the .map_err(Into::into) shape so the docs reproduce the template verbatim. Fixed in both occurrences (lines 74 and 303, the level-1 and level-2 lib.rs blocks). Signed-off-by: Eric Gregory <eric@cosmonic.com>
…#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three quickstart-prose bugs surfaced while building the CI-tested "Add persistent storage" examples (wasmCloud/wasmCloud#5272 and wasmCloud/typescript#668, both merged) that the quickstart walks users through. This catches the docs up to what actually compiles.