Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crates/spin-wasip3-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
#[doc(hidden)]
pub use wasip3;

pub use wasip3::{
http_compat::{IncomingMessage, Request, Response},
wit_bindgen::{self, spawn},
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the train has already left the station, but re-exporting wasip3 which itself includes all of wit_bindgen makes backwards compat very difficult. We're tying ourselves to the exact public API of two external crates. Maybe that's unavoidable...

Copy link
Contributor

@lann lann Nov 13, 2025

Choose a reason for hiding this comment

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

I think wit-bindgen is effectively "std-like" for async Rust guests. wasip3 is a little different but we have to at least secretly re-export it to make #[http_service] work.

wit_future, wit_stream,
};

use hyperium as http;
use std::any::Any;
pub use wasip3::http_compat::{Request, Response};
use wasip3::{
http::types,
http_compat::{
Expand Down
2 changes: 1 addition & 1 deletion examples/wasip3-concurrent-outbound-http-calls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn handle_concurrent_outbound_http_calls(_req: spin_sdk::http_wasip3::Requ
// Spawn a task to run the application logic and stream the results
// to the client. `spawn` continues to run this future even after the
// function has exited with the return of the Response object.
spin_sdk::http_wasip3::wasip3::wit_bindgen::spawn(
spin_sdk::http_wasip3::spawn(
handle_concurrent_outbound_http_calls_impl(tx)
);

Expand Down
2 changes: 1 addition & 1 deletion examples/wasip3-streaming/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async fn handle_wasip3_streaming(request: Request) -> impl IntoResponse {

// Use wit_bindgen::spawn to allow the async block to keep running
// after the handler returns.
spin_sdk::http_wasip3::wasip3::wit_bindgen::spawn(async move {
spin_sdk::http_wasip3::spawn(async move {
tx.send("-- INBOUND MESSAGE --\n".into()).await.unwrap();
// Keep processing data from the incoming body stream until it ends...
loop {
Expand Down