Skip to content

Commit a64a0a6

Browse files
Checkpointing: have a chat UI setup.
1 parent 88db94f commit a64a0a6

File tree

9 files changed

+370
-46
lines changed

9 files changed

+370
-46
lines changed

Cargo.lock

Lines changed: 228 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hydroflow/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ serde_json = "1.0.115"
5959
slotmap = "1.0.0"
6060
smallvec = "1.6.1"
6161
tokio-stream = { version = "0.1.3", default-features = false, features = [ "time", "io-util", "sync" ] }
62-
tokio-tungstenite = "0.23.1"
62+
tokio-tungstenite = { version = "0.23.1", optional = true }
6363
tracing = "0.1.37"
6464
variadics = { path = "../variadics", version = "^0.0.6" }
6565
web-time = "1.0.0"
@@ -74,6 +74,7 @@ tokio-util = { version = "0.7.5", features = [ "net", "codec" ] }
7474
[target.'cfg(target_arch = "wasm32")'.dependencies]
7575
tokio = { version = "1.29.0", features = [ "rt" , "sync", "macros", "io-util", "time" ] }
7676
tokio-util = { version = "0.7.5", features = [ "codec" ] }
77+
wasm-bindgen-futures = "0.4.43"
7778
# We depend on getrandom transitively through rand. To compile getrandom to
7879
# WASM, we need to enable its "js" feature. However, rand does not expose a
7980
# passthrough to enable "js" on getrandom. As a workaround, we enable the

hydroflow/src/scheduled/context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ impl Context {
190190
for task in self.tasks_to_spawn.drain(..) {
191191
self.task_join_handles.push(tokio::task::spawn_local(task));
192192
}
193+
193194
}
194195

195196
/// Aborts all tasks spawned with [`Self::spawn_tasks`].

hydroflow/src/util/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ pub use socket::*;
2929

3030
#[cfg(feature = "deploy_integration")]
3131
pub mod deploy;
32+
33+
#[cfg(not(target_arch = "wasm32"))]
3234
mod websocket;
35+
#[cfg(not(target_arch = "wasm32"))]
3336
pub use websocket::*;
3437

3538
use std::io::Read;

hydroflow/src/util/websocket.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use tokio_tungstenite::tungstenite::{Error, Message};
1010
use crate::util::unsync::mpsc::{Receiver, Sender};
1111
use crate::util::unsync_channel;
1212

13+
1314
pub async fn bind_websocket(endpoint: SocketAddr) -> Result<(Sender<(Message, SocketAddr)>, Receiver<Result<(Message, SocketAddr), Error>>, SocketAddr), std::io::Error>{
1415
let listener = TcpListener::bind(endpoint).await.unwrap();
1516

wasm_test_site/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ edition = "2018"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11+
gloo = { version = "0.11.0", features = ["futures"] }
1112
hydroflow = { path = "../hydroflow" }
1213
wasm-bindgen = "0.2.84"
1314
wasm-bindgen-futures = "0.4.43"
14-
web-sys = { version = "0.3.51", features = [ "console" ] }
15+
web-sys = { version = "0.3.51", features = [ "console", "Window", "Document", "Element", "HtmlElement", "HtmlInputElement", "EventTarget"] }
1516

1617
# The `console_error_panic_hook` crate provides better debugging of panics by
1718
# logging them with `console.error`. This is great for development, but requires
1819
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
1920
# code size when deploying.
2021
console_error_panic_hook = "0.1.7"
22+
futures = "0.3.30"
2123

2224
[dev-dependencies]
2325
wasm-bindgen-test = "0.3.34"

0 commit comments

Comments
 (0)