make regestering server functions optional

This commit is contained in:
Evan Almloff committed 2023-06-19 16:08:46 -05:00
1 parent 8a16eb4cb3
commit 158852e5a0
17 files changed
+106 -79

No files matched your search

+1 -1
View File
@@ -35,7 +35,6 @@ use server_fn_macro::*;
/// ```
///
/// Note the following:
/// - You must **register** the server function by calling `T::register()` somewhere in your main function.
/// - **Server functions must be `async`.** Even if the work being done inside the function body
/// can run synchronously on the server, from the client’s perspective it involves an asynchronous
/// function call.
@@ -62,6 +61,7 @@ pub fn server(args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
match server_macro_impl(
args.into(),
s.into(),
syn::parse_quote!(::dioxus_fullstack::prelude::ServerFnTraitObj),
Some(context),
Some(syn::parse_quote!(::dioxus_fullstack::prelude::server_fn)),
) {