mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 15:44:42 -05:00
Compare commits
3 Commits
v0.8.0-rc1
...
proc-macro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
134d0ba537 | ||
|
|
28d9b3676d | ||
|
|
bb47916ebe |
@@ -352,10 +352,10 @@ pub fn handle_server_fns_with_context(
|
||||
owner
|
||||
.with(|| {
|
||||
ScopedFuture::new(async move {
|
||||
additional_context();
|
||||
provide_context(Request::new(&req));
|
||||
let res_options = ResponseOptions::default();
|
||||
provide_context(res_options.clone());
|
||||
additional_context();
|
||||
|
||||
// store Accepts and Referer in case we need them for redirect (below)
|
||||
let accepts_html = req
|
||||
|
||||
@@ -381,10 +381,10 @@ async fn handle_server_fns_inner(
|
||||
owner
|
||||
.with(|| {
|
||||
ScopedFuture::new(async move {
|
||||
additional_context();
|
||||
provide_context(parts);
|
||||
let res_options = ResponseOptions::default();
|
||||
provide_context(res_options.clone());
|
||||
additional_context();
|
||||
|
||||
// store Accepts and Referer in case we need them for redirect (below)
|
||||
let accepts_html = req
|
||||
@@ -2053,8 +2053,8 @@ where
|
||||
} else {
|
||||
let mut res = handle_response_inner(
|
||||
move || {
|
||||
additional_context();
|
||||
provide_context(state.clone());
|
||||
additional_context();
|
||||
},
|
||||
move || shell(options),
|
||||
req,
|
||||
|
||||
@@ -361,7 +361,7 @@ fn normalized_call_site(site: proc_macro::Span) -> Option<String> {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(all(debug_assertions, feature = "nightly", rustc_nightly))] {
|
||||
Some(leptos_hot_reload::span_to_stable_id(
|
||||
site.source_file().path(),
|
||||
site.file(),
|
||||
site.start().line()
|
||||
))
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@ use reactive_graph::{
|
||||
traits::DefinedAt,
|
||||
};
|
||||
use server_fn::{
|
||||
error::{FromServerFnError, ServerFnErrorErr, ServerFnErrorWrapper},
|
||||
error::{FromServerFnError, ServerFnUrlError},
|
||||
ServerFn,
|
||||
};
|
||||
use std::{ops::Deref, panic::Location, sync::Arc};
|
||||
@@ -62,19 +62,7 @@ where
|
||||
pub fn new() -> Self {
|
||||
let err = use_context::<ServerActionError>().and_then(|error| {
|
||||
(error.path() == S::PATH)
|
||||
.then(|| {
|
||||
error
|
||||
.err()
|
||||
.parse::<ServerFnErrorWrapper<S::Error>>()
|
||||
.map(|e| e.0)
|
||||
.unwrap_or_else(|e| {
|
||||
S::Error::from_server_fn_error(
|
||||
ServerFnErrorErr::Deserialization(
|
||||
e.to_string(),
|
||||
),
|
||||
)
|
||||
})
|
||||
})
|
||||
.then(|| ServerFnUrlError::<S::Error>::decode_err(error.err()))
|
||||
.map(Err)
|
||||
});
|
||||
Self {
|
||||
@@ -162,19 +150,7 @@ where
|
||||
pub fn new() -> Self {
|
||||
let err = use_context::<ServerActionError>().and_then(|error| {
|
||||
(error.path() == S::PATH)
|
||||
.then(|| {
|
||||
error
|
||||
.err()
|
||||
.parse::<ServerFnErrorWrapper<S::Error>>()
|
||||
.map(|e| e.0)
|
||||
.unwrap_or_else(|e| {
|
||||
S::Error::from_server_fn_error(
|
||||
ServerFnErrorErr::Deserialization(
|
||||
e.to_string(),
|
||||
),
|
||||
)
|
||||
})
|
||||
})
|
||||
.then(|| ServerFnUrlError::<S::Error>::decode_err(error.err()))
|
||||
.map(Err)
|
||||
});
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user