-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP upgrade to leptos-0.7 #38
base: main
Are you sure you want to change the base?
WIP upgrade to leptos-0.7 #38
Conversation
Changes - Changed Rc<RefCell<..>> to Arc<Mutex<..>> everywhere to get Sync + Send - Added many Send + Sync constraints - Removed default_options from QueryOptions since not supported in Resource any more - Switched to serde_json and serde over miniserde because leptos has a dependency on serde_json already anyway - Undo async trait removal in 'WIP upgrade to leptos-0.7'; It is needed to use this type as trait objects - Removed gloo_timers::future::sleep and used futures::future::pending instead as the future returned by gloo_timers::future::sleep is not Sync Status - start-axum compiles but keeps saying 'Loading...' unless you do prefetch first - start-csr is still todo - ResourceOption::Local option is still todo - I don't know yet how to convert this to 0.7 ``` if resource.loading().get_untracked() && !HydrationCtx::is_hydrating() && query.with_state(|state| matches!(state, QueryState::Created)) { query.execute() } ```
- Use signals to manually interupt the pending future in initial query generator - New execute method that can run while hydrating (uses resource and effect)
I tried to do as much as possible, but running into a few difficult parts where I don't really know how to proceed. See the comments above. So for now I'll stop working on this. And I don't expect to be able to finish this in the future. But I'll leave this PR open so hopefully someone else can give it a try also :). What works:
What doesn't work (see also comment above)
|
Great work :) |
Hi @stefanboere, Thank you so much for all your efforts on this! I was wondering if you might have a simple example repository that works with your upgrade? I’ve been trying to implement it myself but ran into some issues with the Send trait. I think having a reference implementation would be incredibly helpful, not just for me but for many others as well. Thanks a ton in advance! 🙏 |
@stefanboere anything I can help with? |
Hi, Unfortunately I do not have a simple example repository and I'm stil working on my own complicated repo. But you can look at the leptos-query-axum-workspace example in this repo. For help, yeah, maybe what is stated in the comments, but I don't know. Maybe I can try next week to put a bit more details in here where precisely I'm stuck, but you could also try the leptos-query-axum-workspace example and test what works and what doesn't. |
Changes:
Open issues:
Solved but not sure if solved correctly
Any help on these open points would be appreciated :).