-
Notifications
You must be signed in to change notification settings - Fork 6
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
Leptos 0.7 Support #44
Comments
@benwis I'm trying to get this working and am currently stalled on server functions: calling
I think this is because the It looks like the escape hatch for environments other than Axum or Actix is to provide types to the macro ( Do you know of a way to infer Spin request and response types that's transparent to users of the macro? If not, is the only remedy to send a PR for Spin support directly into the |
@itowlson Sorry I missed this one, but passing SpinRequest and SpinResponse to the server macro is part of the leptos-spin-macro crate. Assuming you've imported that one and not the standard server, the other typical cause of this is feature flag issues, Once I'm back from Vienna for EuroRust I can take a deeper look |
I would be interested in seeing this completed -- I have been dabbling in Leptos + Spin and am hoping to use some of the 0.7 components from the Thaw UI library. Let me know if I can help on this! |
So there's two stages here. One is to bring this to the latest 0.6 version. That should be easy, and is probably a cargo update away. The second is to update it to 0.7, which is the version that's currently a release candidate.
That'll likely involve a bit more work. If you'd like to attempt either, PRs are welcome. Feel free to ask me for help, I'm usually a bit faster to respond on Discord
…On Tue, Oct 15, 2024, at 6:50 AM, Darwin Boersma wrote:
I would be interested in seeing this completed -- I have been dabbling in Leptos + Spin and am hoping to use some of the 0.7 components from the Thaw UI library. Let me know if I can help on this!
—
Reply to this email directly, view it on GitHub <#44 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABVBTCKCBD6C35KJXHQQOG3Z3UMQTAVCNFSM6AAAAABN4VQT62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJTHE3TOOBZGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Awesome! I went ahead and created #46 to upgrade to the latest version of 0.6 leptos :) I will dig into the 0.7 upgrade tonight! |
0.7 upgrade is certainly a bigger lift! I need to grok the Leptos server internals/how the 0.6 connection works/architectural changes made in 0.7. Then I can meaningfully contribute to this 0.7 update. I will dig into these learnings this weekend. If @itowlson is further along with the 0.7 update, don't let me hold it up! |
@ogghead I'm currently away from the 0.7 update on other things - I did start looking but very quickly came up against the substantive API changes and got myself in a huge muddle. So if you see a way forward then please dive in! Thanks for all your work on this! |
No worries, sounds about like where I ended up 😂 I will take another crack at it with the rc1 version of 0.7 |
I have created a PR for a partial draft of 0.7 -- got most functions compiling but for about 1/3 of lib.rs. I will continue to dig into Leptos 0.7 code to look for a good upgrade path for remaining functionality, but if ya'll (especially @benwis as the resident Leptos expert) have any feedback, much appreciated! This is definitely a hacky draft with lots of clones and hastily created mappings to try to modify existing code as little as possible |
I found https://github.com/leptos-rs/leptos_wasi and leptos-rs/leptos#3063 while sleuthing -- @benwis I wonder if we should consider holding off on making major refactors in the Spin integration and utilize this WASI integration after it stabilizes? |
Would gladly collaborate with any Spin folks out there to see if crates can interop ! :) |
Thanks for the offer @raskyld and for your work creating this general WASI integration in Leptos! I am going to dig into this today -- Spin supports running WASI-HTTP components so my hope is that it will just work with minimal modifications through the power of WASI |
Wow! Yes, that sure looks very close to the ground that leptos-spin covers! It would be great to have a common framework for this stuff inside the Leptos org. One possible concern is I'd be reluctant to force developers to write to the WASIp2 bindings right now (the p1 target has more mature support for using the familiar standard library). But that's not a blocker, because p2 will improve over time, and the benefits of having a common p2-based framework may outweigh the inconvenience. We'll have a better sense of it once we kick the tyres on some applications and get a feel for how they look. |
Good call @itowlson -- I created a prototype using wasip1 bindings for now. With some slight tweaks to mesh the existing Spin leptos template with https://github.com/raskyld/leptos-wasmcloud setup, I got a Spin app technically running (the best kind). Can confirm the server fn button opens a Spin-provided wasi kv store and updates data server-side after client side interaction. This gets us 99% of the way there already it seems! I am seeing one oddity where the static site is not replaced by the hydrated version and instead is duplicated, but created https://github.com/ogghead/leptos-wasi-test with current prototype Spin app -- once I am able to determine the source of this last bug and play around with the integration a bit more, I suspect we can cut all code and only need a template in the Very much appreciate feedback, and please do let me know if there are any pitfalls with this approach I have not considered. Tentatively, this integration appears to work almost seamlessly |
Fixed that last issue -- it was a one line fix in the hydration portion for my demo. So, I can confirm this WASI integration works seamlessly with Spin apps! We will need Leptos 0.7 rc1 released to get all necessary changes from tagged crate versions rather than git + local path references, but that should only require tweaks in cargo.toml. I will then transfer these changes back into the leptos-spin template and update the 0.7 PR to remove all the rest of the code and only include this template. I will jump on that as soon as rc1 version of Leptos is released 😄 |
Tentatively updated the template to a draft version pointing to git repositories directly -- this template works for me |
That's very exciting! I'll take a look at and try to review things this week, but it's always good to reduce the number of integrations.
…On Mon, Nov 4, 2024, at 8:18 AM, Darwin Boersma wrote:
Tentatively updated the template to a draft version pointing to git repositories directly -- this template works for me
—
Reply to this email directly, view it on GitHub <#44 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABVBTCK3KQK4OEYUNXXJAPLZ66F3PAVCNFSM6AAAAABN4VQT62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJVGEZTQNBVGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This is very, very cool. Thank you so much @ogghead for jumping into this. |
I was waiting for rc1 as well to truly test end-to-end the integration crate and make necessary tweaks :D It just got released: https://github.com/leptos-rs/leptos/releases/tag/v0.7.0-rc1 I am really happy that the integration went seamlessly, my end goal breaking the work in two phases:
was exactly to enable different runtime vendors to collaborate on their mutual foundations 🎉 And in this specific case, you can truly say it was a virtuous cycle since I took inspiration from your work on this repository to build |
I created one small PR to update to rc1 for leptos_wasi and one small PR to allow (in rc2 or release version) using the Executor re-exported in the Leptos crate. I updated the Spin template to point to rc1 versions and (for now) my branch of leptos_wasi with those dependency updates and can confirm it still works as expected. @raskyld huge props for creating leptos_wasi, and glad it was a virtuous cycle with the excellent work put into creating leptos-spin! If you have capacity to check my PR for leptos_wasi, that would be much appreciated |
I will check that tonight (in a few hours since I am EU based) anyway since I am now unblocked by the release of rc1! |
With #48 merged, remaining steps are:
|
leptos_wasi is now on 0.7 on version 0.1.l3 |
With #55, I think this issue can be resolved 🚀 |
Its getting close to release and we'll need to update this
The text was updated successfully, but these errors were encountered: