You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to follow the book I end up with a non async component trying to make async calls to the DB etc. The code started to get complex and felt unwieldy.
With normal Axum routes I get type safe extractions without writing any code. With Leptos I have to manually extract everything. Feels like a step back.
I tried writing a normal async Axum route to call the async functions then construct a Leptos component. However I couldn't figure out how to convert this into an Axum Response.
Example Axum route I tried (doesn't compile)
pubasyncfnindex() -> String{let html = leptos::ssr::render_to_string_async(|| IndexPage().into_view());
html.await}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm currently looking at the feasibility of moving my open source project from Dioxus to Leptos. This is because I want the following features.
islands
feature.cargo leptos
build, which makes life easier.Here's the current architecture for page generation
islands
are picked up by the typescript and brought to life.An example route is here https://github.com/bionic-gpt/bionic-gpt/blob/main/crates/axum-server/src/api_keys/index.rs
I have the following issues
Example Axum route I tried (doesn't compile)
What I'd ideally like is the following to work
Update
Actually I got it working with this.
Beta Was this translation helpful? Give feedback.
All reactions