Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c3ed874
Create websocket protocol trait
ealmloff Feb 19, 2025
131f414
move run client into the protocol trait
ealmloff Feb 20, 2025
73dd677
switch to async fn for get implementation
ealmloff Feb 20, 2025
1a7b40b
implement gloo websockets
ealmloff Feb 21, 2025
7eb8ca7
switch most encodings into the new system
ealmloff Feb 24, 2025
6904eec
remove into/from request/response bounds on server fn
ealmloff Feb 24, 2025
9b9983a
expose encoding types
ealmloff Feb 25, 2025
7479010
unified http protocol for non-websocket sever functions
ealmloff Feb 25, 2025
c286812
move the server request and response into a separate trait
ealmloff Feb 26, 2025
2747a49
fix formatting
ealmloff Feb 26, 2025
2037bf1
Merge branch 'leptos_0.8' into websockets
ealmloff Feb 26, 2025
a4b0d34
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 26, 2025
d4cfd0e
Move content type to a separate trait
ealmloff Feb 26, 2025
f488d4b
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 26, 2025
b800c00
Integrate the websocket protocol with the server function macro
ealmloff Feb 27, 2025
4fc8972
make the into websocket function async
ealmloff Feb 28, 2025
c97ab9a
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 28, 2025
a1cd7ae
implement reqwest websocket integration
ealmloff Mar 3, 2025
4d9ec54
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 3, 2025
5149ad5
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Mar 3, 2025
5b484ea
[autofix.ci] apply automated fixes (attempt 3/3)
autofix-ci[bot] Mar 3, 2025
bb62d08
implement actix integration
ealmloff Mar 5, 2025
f49f096
remove default actix feature
ealmloff Mar 5, 2025
901e038
update form integration
ealmloff Mar 5, 2025
860ad7a
return an error when the sever doesn't support spawning tasks
ealmloff Mar 5, 2025
65b5d55
deny missing docs
ealmloff Mar 5, 2025
f069d44
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 5, 2025
d84ab6d
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Mar 5, 2025
fee4bcc
Create post type aliases for encodings
ealmloff Mar 7, 2025
1e57961
chore: remove unused import
gbj Mar 7, 2025
352080d
fix: don't use `ws` feature of Axum on JS-fetch/no-default platform
gbj Mar 7, 2025
66f9c8c
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 7, 2025
2e4d94b
Add encoding suffix to the encoding types and revert renaming the pos…
ealmloff Mar 7, 2025
b6d2808
Document the protocol trait and implementations
ealmloff Mar 7, 2025
787bf38
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 7, 2025
18570e9
Fix clippy
ealmloff Mar 7, 2025
3ca9827
forward server fn visibility
ealmloff Mar 10, 2025
599c87c
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 10, 2025
28eb968
chore: fix up doctests on `server_fn` crate
gbj Mar 10, 2025
d2c81fe
change: enable `url` and `json` by default on `server_fn`
gbj Mar 10, 2025
bc48aa4
chore: reexport `Bytes` to make it easier to implement `Client`
gbj Mar 11, 2025
5034539
chore: update `server_fns_axum` example
gbj Mar 11, 2025
f65d87d
chore: allow dead code in example
gbj Mar 11, 2025
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
131 changes: 122 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions any_error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
error,
fmt::{self, Display},
future::Future,
mem, ops,
ops,
pin::Pin,
sync::Arc,
task::{Context, Poll},
Expand Down Expand Up @@ -103,9 +103,7 @@ pub fn get_error_hook() -> Option<Arc<dyn ErrorHook>> {

/// Sets the current thread-local error hook, which will be invoked when [`throw`] is called.
pub fn set_error_hook(hook: Arc<dyn ErrorHook>) -> ResetErrorHookOnDrop {
ResetErrorHookOnDrop(
ERROR_HOOK.with_borrow_mut(|this| mem::replace(this, Some(hook))),
)
ResetErrorHookOnDrop(ERROR_HOOK.with_borrow_mut(|this| this.replace(hook)))
}

/// Invokes the error hook set by [`set_error_hook`] with the given error.
Expand Down
10 changes: 5 additions & 5 deletions leptos/src/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use server_fn::{
codec::PostUrl,
error::{IntoAppError, ServerFnErrorErr},
request::ClientReq,
ServerFn,
Http, ServerFn,
};
use tachys::{
either::Either,
Expand Down Expand Up @@ -75,7 +75,7 @@ use web_sys::{
/// ```
#[cfg_attr(feature = "tracing", tracing::instrument(level = "trace", skip_all))]
#[component]
pub fn ActionForm<ServFn>(
pub fn ActionForm<ServFn, OutputProtocol>(
/// The action from which to build the form.
action: ServerAction<ServFn>,
/// A [`NodeRef`] in which the `<form>` element should be stored.
Expand All @@ -86,7 +86,7 @@ pub fn ActionForm<ServFn>(
) -> impl IntoView
where
ServFn: DeserializeOwned
+ ServerFn<InputEncoding = PostUrl>
+ ServerFn<Protocol = Http<PostUrl, OutputProtocol>>
+ Clone
+ Send
+ Sync
Expand Down Expand Up @@ -151,7 +151,7 @@ where
/// [`form`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form)
/// progressively enhanced to use client-side routing.
#[component]
pub fn MultiActionForm<ServFn>(
pub fn MultiActionForm<ServFn, OutputProtocol>(
/// The action from which to build the form.
action: ServerMultiAction<ServFn>,
/// A [`NodeRef`] in which the `<form>` element should be stored.
Expand All @@ -165,7 +165,7 @@ where
+ Sync
+ Clone
+ DeserializeOwned
+ ServerFn<InputEncoding = PostUrl>
+ ServerFn<Protocol = Http<PostUrl, OutputProtocol>>
+ 'static,
ServFn::Output: Send + Sync + 'static,
<<ServFn::Client as Client<ServFn::Error>>::Request as ClientReq<
Expand Down
Loading
Loading