missing makefiles

This commit is contained in:
Greg Johnston 2024-01-10 14:08:51 -05:00
parent 2af0d3d781
commit 81fb5160e5
6 changed files with 17 additions and 2 deletions

View file

@ -50,6 +50,7 @@ rkyv = { version = "0.7", features = [
# client
gloo-net = { version = "0.5", optional = true }
js-sys = { version = "0.3", optional = true }
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
wasm-streams = { version = "0.4", optional = true }
web-sys = { version = "0.3", optional = true, features = [
@ -79,6 +80,7 @@ browser = [
"dep:gloo-net",
"dep:js-sys",
"dep:send_wrapper",
"dep:wasm-bindgen",
"dep:web-sys",
"dep:wasm-streams",
"dep:wasm-bindgen-futures",

1
server_fn/Makefile.toml Normal file
View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }

View file

@ -0,0 +1,4 @@
extend = { path = "../../cargo-make/main.toml" }
[tasks.check-format]
env = { LEPTOS_PROJECT_DIRECTORY = "../../" }

View file

@ -134,7 +134,7 @@ impl<E: std::error::Error + Clone> ViaError<E> for &&WrapError<E> {
// we can still wrap it in String form
impl<E: Display + Clone> ViaError<E> for &WrapError<E> {
fn to_server_error(&self) -> ServerFnError<E> {
ServerFnError::WrappedServerError(self.0.clone())
ServerFnError::ServerError(self.0.to_string())
}
}
@ -179,6 +179,12 @@ pub enum ServerFnError<E = NoCustomError> {
MissingArg(String),
}
impl ServerFnError<NoCustomError> {
pub fn new(msg: impl ToString) -> Self {
Self::ServerError(msg.to_string())
}
}
impl<CustErr> From<CustErr> for ServerFnError<CustErr> {
fn from(value: CustErr) -> Self {
ServerFnError::WrappedServerError(value)

View file

@ -3,9 +3,10 @@ use crate::{error::ServerFnError, redirect::REDIRECT_HEADER};
use bytes::Bytes;
use futures::{Stream, StreamExt};
pub use gloo_net::http::Response;
use js_sys::{wasm_bindgen::JsCast, Uint8Array};
use js_sys::Uint8Array;
use send_wrapper::SendWrapper;
use std::future::Future;
use wasm_bindgen::JsCast;
use wasm_streams::ReadableStream;
pub struct BrowserResponse(pub(crate) SendWrapper<Response>);

View file

@ -0,0 +1 @@
extend = { path = "../cargo-make/main.toml" }