TEMP: Compile wasm dependencies&code per default

TODO: Check todos before merging into dev
This commit is contained in:
bitfl0wer 2023-11-19 12:52:11 +01:00
parent 9f45094bd9
commit 926a9fc90e
2 changed files with 8 additions and 2 deletions

View File

@ -54,6 +54,9 @@ sqlx = { version = "0.7.1", features = [
], optional = true } ], optional = true }
safina-timer = "0.1.11" safina-timer = "0.1.11"
rand = "0.8.5" rand = "0.8.5"
# TODO: Remove the below 2 imports for production!
ws_stream_wasm = "0.7.4"
pharos = "0.5.3"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rustls = "0.21.8" rustls = "0.21.8"

View File

@ -2,7 +2,8 @@
pub mod default; pub mod default;
pub mod events; pub mod events;
pub mod message; pub mod message;
#[cfg(all(target_arch = "wasm32", feature = "client"))] // TODO: Uncomment for Prod!
// #[cfg(all(target_arch = "wasm32", feature = "client"))]
pub mod wasm; pub mod wasm;
#[cfg(all(not(target_arch = "wasm32"), feature = "client"))] #[cfg(all(not(target_arch = "wasm32"), feature = "client"))]
@ -10,7 +11,8 @@ pub use default::*;
pub use message::*; pub use message::*;
use safina_timer::sleep_until; use safina_timer::sleep_until;
use tokio::task::JoinHandle; use tokio::task::JoinHandle;
#[cfg(all(target_arch = "wasm32", feature = "client"))] // TODO: Uncomment for Prod!
// #[cfg(all(target_arch = "wasm32", feature = "client"))]
pub use wasm::*; pub use wasm::*;
use self::events::Events; use self::events::Events;
@ -171,6 +173,7 @@ where
/// Returns a Result with a matching impl of [`GatewayHandleCapable`], or a [`GatewayError`] /// Returns a Result with a matching impl of [`GatewayHandleCapable`], or a [`GatewayError`]
/// ///
/// DOCUMENTME: Explain what this method has to do to be a good get_handle() impl, or link to such documentation /// DOCUMENTME: Explain what this method has to do to be a good get_handle() impl, or link to such documentation
/// TODO: Give spawn a default trait impl, avoid code duplication
async fn spawn<G: GatewayHandleCapable<T, S>>(websocket_url: String) async fn spawn<G: GatewayHandleCapable<T, S>>(websocket_url: String)
-> Result<G, GatewayError>; -> Result<G, GatewayError>;
async fn close(&mut self); async fn close(&mut self);