Skip to content
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

Bump leptos_router from 0.4.6 to 0.4.8 #40

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 4, 2023

Bumps leptos_router from 0.4.6 to 0.4.8.

Release notes

Sourced from leptos_router's releases.

v0.4.8

There was a log erroneously left in 0.4.7, so I rereleased as 0.4.8. Notes for 0.4.7 below.

This is mostly a bug-fix release with a few small features. There will probably be one or two more patch releases before 0.5.0.

New Features

mut in component props

This didn't work before; now it does:

#[component]
fn TestMutCallback<'a, F>(
    cx: Scope,
    mut callback: F,
    value: &'a str,
) -> impl IntoView
where
    F: FnMut(u32) + 'static,
{

MaybeProp type

MaybeProp is essentially a wrapper for Option<MaybeSignal<Option<T>>> with a nicer API. This is useful for something like a component library, where you want to give a user the maximum flexibility in the types they give to props while still checking that they're the appropriate T.

This allows you to define optional props that

  1. may or may not be provided
  2. if provided, may be a plain value or a signal
  3. if a signal type, may or may not have a value (i.e., are a Signal<Option<T>>)

Implementing From<_> for a plain Signal<T> type here is possible, but depends on the changes in 0.5.0, so I'll add it for that release.

#[component]
pub fn App(cx: Scope) -> impl IntoView {
    let (count, set_count) = create_signal(cx, 5);
view! { cx,
    &lt;TakesMaybeProp/&gt;
    &lt;TakesMaybeProp maybe=42/&gt;
    &lt;TakesMaybeProp maybe=Signal::derive(cx, move || Some(count.get()))/&gt;
}

}
#[component]
pub fn TakesMaybeProp(cx: Scope, #[prop(optional, into)] maybe: MaybeProp<i32>) -> impl IntoView {
// .get() gives you Option&lt;T&gt;, replacing self.as_ref().and_then(|n| n.get())
let value: Option<i32> = maybe.get();
// .with() takes a plain &amp;T; returns None if the prop isn't present or the inner value is None
</tr></table>

... (truncated)

Commits

Dependabot compatibility score

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 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)

Bumps [leptos_router](https://github.com/leptos-rs/leptos) from 0.4.6 to 0.4.8.
- [Release notes](https://github.com/leptos-rs/leptos/releases)
- [Commits](leptos-rs/leptos@v0.4.6...v0.4.8)

---
updated-dependencies:
- dependency-name: leptos_router
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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 Aug 4, 2023
@shamilsan shamilsan merged commit 6b4a0a0 into master Aug 4, 2023
1 check passed
@shamilsan shamilsan deleted the dependabot/cargo/leptos_router-0.4.8 branch August 4, 2023 08:49
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.

1 participant