Skip to content

feat(examples): add http-hello-world-hono-persistent-storage#668

Merged
ericgregory merged 1 commit into
wasmCloud:mainfrom
ericgregory:ci/test-quickstart-templates
Jun 22, 2026
Merged

feat(examples): add http-hello-world-hono-persistent-storage#668
ericgregory merged 1 commit into
wasmCloud:mainfrom
ericgregory:ci/test-quickstart-templates

Conversation

@ericgregory

@ericgregory ericgregory commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Adds the TypeScript Hono component as it stands at the end of the wasmcloud.com quickstart's Add persistent storage step for testing.

Companion PR

wasmCloud/wasmCloud#5272 does the same thing for the Rust side.

@ericgregory ericgregory requested review from a team as code owners June 19, 2026 17:59
@vados-cosmonic

Copy link
Copy Markdown
Contributor

Hey same comment as over on the Rust side here -- I wonder if we should just add another example, or extend the example code that's in there right now

Adds the TypeScript Hono component as it stands at the end of the
wasmcloud.com quickstart's "Add persistent storage" step — the
templates/http-hello-world-hono starting point plus wasi:keyvalue
imports in wit/world.wit and the per-name counter in
src/component.ts. The standard examples workflow picks it up via
one new entry in the components matrix.

The entry uses skip-wash-dev: true with an empty test-command,
because the component imports wasi:keyvalue at runtime and wash dev
doesn't auto-provision a keyvalue provider in CI. The build pass
alone catches the drift this example exists to surface — template
package.json's jco-std version vs. world.wit's wasi:http and
wasi:keyvalue versions vs. what the adapter bundles.

Replaces the earlier tests/quickstart/*.sh overlay + dedicated
workflow draft per @vados-cosmonic's review on wasmCloud#668 — having the
end-state code in-tree as an example obviates the need for a
parallel CI mechanism.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
@ericgregory ericgregory force-pushed the ci/test-quickstart-templates branch from 43d6a21 to be28aff Compare June 22, 2026 16:20
@ericgregory ericgregory requested review from a team as code owners June 22, 2026 16:20
@ericgregory ericgregory changed the title ci: test the quickstart-modified variant of http-hello-world-hono feat(examples): add http-hello-world-hono-persistent-storage Jun 22, 2026

@ericgregory ericgregory left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same redesign as on the Rust side (#5272) — you were definitely right that adding the quickstart-modified code as a regular example is much cleaner.

@vados-cosmonic

Copy link
Copy Markdown
Contributor

Yeah it's going to be very nice to be able to just point at/link to this!

@vados-cosmonic vados-cosmonic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Small nit about dep versions, but that can be left to a follow up!

"hono": "^4.12.21"
},
"devDependencies": {
"@bytecodealliance/jco": "^1.15.4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to safely update Jco to 1.24.3 here...
And also the other versions as well --

rolldown @ ^1.1.2
typescript @ ^6.0.3
rimraf @ ^6.1.3
nodemon @ ^3.1.14

@ericgregory ericgregory merged commit 4c41d1e into wasmCloud:main Jun 22, 2026
24 checks passed
ericgregory added a commit to wasmCloud/wasmcloud.com that referenced this pull request Jul 1, 2026
Three issues surfaced while building the working examples (wasmCloud
#5276 and typescript #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 #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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants