From: Dominik Csapak <d.csapak@proxmox.com>
To: Yew framework devel list at Proxmox <yew-devel@lists.proxmox.com>,
Dietmar Maurer <dietmar@proxmox.com>
Subject: Re: [yew-devel] [PATCH yew-widget-toolkit] props: replace `BuilderFn` with `RenderFn`
Date: Fri, 12 Dec 2025 08:31:21 +0100 [thread overview]
Message-ID: <b1083872-798b-4da1-9e86-a72a1a14b9c4@proxmox.com> (raw)
In-Reply-To: <mj1hszzp.3n38mpp0gfs00@proxmox.com>
On 12/11/25 2:50 PM, Dietmar Maurer wrote:
>
> I think this was the reason I invented the whole thing.
>
> > The only slightly awkward changes are: * we now have to use
> `apply(&())` in this case * when giving a callback to such a builder we
> have to use `|_: &_|` now, but this was also the case for any closure
> that got converted into a `RenderFn`.
>
> Being forced to use |_: &_| is ugly, and the compiler errors for that
> are even more ugly and confusing. So I am not sure about this change.
>
as i wrote this is already the case for every user of the RenderFn, and
we only use the BuilderFn internally in pwt currently and only in three
places, so I don't think that this is too bad.
On 12/11/25 2:54 PM, Dietmar Maurer wrote:
>
> I thought we can simply use Callback to replace BuilderFn?
i tried, but this would result in other weird usage, e.g.
we'd have to use `emit(())` instead if `apply(&())` which
is also not very intuitive.
also there is no 'into trait' for callbacks with a generic
return value AFAICS
but as discussed off-list, let's wait for yew 0.22 which
introduces a `CallbackRef` that seemingly does something
very similar to our `RenderFn`, then we can maybe
get rid of both RenderFn and BuilderFn
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
next prev parent reply other threads:[~2025-12-12 7:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-11 12:59 Dominik Csapak
2025-12-11 13:49 ` Dietmar Maurer
2025-12-12 7:31 ` Dominik Csapak [this message]
2025-12-11 13:54 ` Dietmar Maurer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b1083872-798b-4da1-9e86-a72a1a14b9c4@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=dietmar@proxmox.com \
--cc=yew-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox