dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Collapse events to `Event<dyn Data>`

Open jkelleyrtp opened this issue 1 year ago • 1 comments

Feature Request

We go through many layers of indirection to support concrete methods on events, but I'm starting to think that the overhead and maintenance burden is not worth it, and that we can mostly solve the discoverability problem either through docs or clever foreign impls.

For example, we stuff dyn HasMouseData inside a MouseData inside an event via Rc<MouseData> which is quite a lot of cruft to wade through.

In reality, I'd like to be able to simply jump to the trait and get its methods rather than dig through 3-4 levels of indirection.

pub struct MouseData {
    inner: Box<dyn HasMouseData>,
}

jkelleyrtp avatar Mar 09 '24 10:03 jkelleyrtp

Do the changes in https://github.com/DioxusLabs/dioxus/pull/3137 and really the prior Synthetic introduced by Evan already resolve this issue? Or is there more still possible?

rogusdev avatar Dec 11 '24 16:12 rogusdev