Skip to content

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github May 5, 2025

Updates the requirements on leptos to permit the latest version.

Release notes

Sourced from leptos's releases.

v0.8.0

*Changelog relative to 0.7.8. *

0.8 has been planned for a while, primarily to accommodate small changes that arose during the course of testing and adopting 0.7, most of which are technically semver-breaking but should not meaningfully affect user code. I think it's a significant QOL and user DX upgrade and I'm excited to properly release it.

Noteworthy features:

  • Axum 0.8 support. (This alone required a major version bump, as we reexport some Axum types.) (thanks to @​sabify for the migration work here)
  • Significant improvements to compile times when using --cfg=erase_components, which is useful as a dev-mode optimization (thanks to @​zakstucke) This is the default setting for cargo-leptos with its latest release, and can be set up manually for use with Trunk. (See docs here.)
  • Support for the new islands-router features that allow a client-side routing experience while using islands (see the islands_router example) (this one was me)
  • Improved server function error handling by allowing you to use any type that implements FromServerFnError rather than being constrained to use ServerFnError (see #3274). (Note: This will require changes if you're using a custom error type, but should be a better experience.) (thanks to @​ryo33)
  • Support for creating WebSockets via server fns (thanks to @​ealmloff)
  • Changes to make custom errors significantly more ergonomic when using server functions
  • LocalResource no longer exposes a SendWrapper in the API for the types it returns. (Breaking change: this will require removing some .as_deref() and so on when using LocalResource, but ends up with a much better API.)
  • Significantly improved DX/bugfixes for thread-local Actions.

As you can see this was a real team effort and, as always, I'm grateful for the contributions of everyone named above, and all those who made commits below.

WebSocket Example

The WebSocket support is particularly exciting, as it allows you to call server functions using the default Rust Stream trait from the futures crate, and have those streams send messages over websockets without you needing to know anything about that process. The API landed in a place that feels like a great extension of the "server function" abstraction in which you can make HTTP requests as if they were ordinary async calls. The websocket stuff doesn't integrate directly with Resources/SSR (which make more sense for one-shot things) but is really easy to use:

use server_fn::{codec::JsonEncoding, BoxedStream, ServerFnError, Websocket};
// The websocket protocol can be used on any server function that accepts and returns a [BoxedStream]
// with items that can be encoded by the input and output encoding generics.
//
// In this case, the input and output encodings are [Json] and [Json], respectively which requires
// the items to implement [Serialize] and [Deserialize].
#[server(protocol = Websocket<JsonEncoding, JsonEncoding>)]
async fn echo_websocket(
input: BoxedStream<String, ServerFnError>,
) -> Result<BoxedStream<String, ServerFnError>, ServerFnError> {
use futures::channel::mpsc;
use futures::{SinkExt, StreamExt};
let mut input = input; // FIXME :-) server fn fields should pass mut through to destructure
// create a channel of outgoing websocket messages 
// we'll return rx, so sending a message to tx will send a message to the client via the websocket
let (mut tx, rx) = mpsc::channel(1);
// spawn a task to listen to the input stream of messages coming in over the websocket
tokio::spawn(async move {
while let Some(msg) = input.next().await {
// do some work on each message, and then send our responses
tx.send(msg.map(|msg| msg.to_ascii_uppercase())).await;
}
});

</tr></table>

... (truncated)

Commits
  • 9b2e313 v0.8.0
  • bc79232 feat: impl From\<MappedSignal<T>> for Signal\<T> (#3897)
  • a7bb256 fix(examples): websocket tests fail (occasionally) second attemp (#3910)
  • 2e393aa fix: leptos_debuginfo (#3899)
  • e37711c fix: correct hydration for elements after island children (closes #3904) (#...
  • 627b553 fix: prevent sibling context leakage in islands (closes #3902) (#3903)
  • e2f9aca Merge pull request #3901 from leptos-rs/3896
  • 970544e fix: correctly hydrate branches inside islands when using islands-router (clo...
  • 0c3b3c4 chore: remove forgotten log
  • 6578086 fix(examples): incorrect routes in hackernews example (closes #3892) (#3894)
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [leptos](https://github.com/leptos-rs/leptos) to permit the latest version.
- [Release notes](https://github.com/leptos-rs/leptos/releases)
- [Commits](leptos-rs/leptos@v0.7.7...v0.8.0)

---
updated-dependencies:
- dependency-name: leptos
  dependency-version: 0.8.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels May 5, 2025
Copy link
Author

dependabot bot commented on behalf of github May 12, 2025

Superseded by #8.

@dependabot dependabot bot closed this May 12, 2025
@dependabot dependabot bot deleted the dependabot/cargo/leptos-0.8.0 branch May 12, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants