Skip to content

Conversation

@jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Oct 7, 2025

Follow up to #4596

  • allow --server only builds!
  • support /:param syntax for old router parser
  • multipart native (test desktop forms…)
  • Put the headers into context so running serverfns on server work as expected

@jkelleyrtp jkelleyrtp changed the title More fullstack fixes, namespaced server_functions More fullstack fixes Oct 7, 2025
@jkelleyrtp jkelleyrtp marked this pull request as ready for review October 8, 2025 05:01
@jkelleyrtp jkelleyrtp requested a review from a team as a code owner October 8, 2025 05:01
@jkelleyrtp jkelleyrtp merged commit 92792ad into main Oct 8, 2025
2 checks passed
@jkelleyrtp jkelleyrtp deleted the jk/more-fullstack-fixes branch October 8, 2025 06:07
@nkemjika-nwokocha
Copy link

Hi @jkelleyrtp

I had a running and working fullstack app, but after i pull the latest ( ##4596) i started having the deprecation issues with server_fn macro #[server]

use of deprecated unit struct service::country::_::GetCountries: Dioxus server functions no longer generate a struct for the server function. The function itself is used directly.

image

The deprecation warning is not clear to me. Please is there any docs that speaks to this ?

@jkelleyrtp
Copy link
Member Author

Hi @jkelleyrtp

I had a running and working fullstack app, but after i pull the latest ( ##4596) i started having the deprecation issues with server_fn macro #[server]

use of deprecated unit struct service::country::_::GetCountries: Dioxus server functions no longer generate a struct for the server function. The function itself is used directly.

image The deprecation warning is not clear to me. Please is there any docs that speaks to this ?

In this case you can just remove the GetCountries parameter - as per the deprecation warning we no longer generate a useful struct from server functions. The new syntax is #[post("/api/endpoint")] or just #[server]

@nkemjika-nwokocha
Copy link

Hi @jkelleyrtp
I had a running and working fullstack app, but after i pull the latest ( ##4596) i started having the deprecation issues with server_fn macro #[server]
use of deprecated unit struct service::country::_::GetCountries: Dioxus server functions no longer generate a struct for the server function. The function itself is used directly.
image
The deprecation warning is not clear to me. Please is there any docs that speaks to this ?

In this case you can just remove the GetCountries parameter - as per the deprecation warning we no longer generate a useful struct from server functions. The new syntax is #[post("/api/endpoint")] or just #[server]

@jkelleyrtp

Thanks for your swift response.

I tried implementing your recommendation of either using #[post("/api/endpoint")] or just #[server].

Using the new syntax for route definition #[server] or #[post("/api/get-countries")] or #[get("/api/get-countries")]
resulted in two experiences:

  1. There's this warning about "unexpected cfg condition value: server no expected values for feature" on the route definition.e

  2. Irrespective of the route definition chosen, there's always a panicked [linux] called Result::unwrap() on an Err value: Deserialization("expected value at line 2 column 21") when calling the server_fn at client callsite.

image image image

@nkemjika-nwokocha
Copy link

At the end, i was able to figure out the fix, and it was just a smart move to remove the #[server] or any form of "server fn" macros outrightly.

E.g
pub async fn do_something() -> Result<Something, ServerFnError> {
// doing something successfully
}

Thanks for making it easier for us to build software solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants