DioxusLabs / dioxus

Fullstack app framework for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
21.53k stars 826 forks source link

build error: no method named `is_empty` found for struct `UnboundedSender` in the current scope #3053

Open dan-arnold opened 1 month ago

dan-arnold commented 1 month ago

Problem

UnboundedSender::is_empty is only present in >= futures-channel-0.3.29, but is used by dioxus-core despite dioxus only depending on futures-channel-0.3.21.

If dioxus is used as a dependency in another project that resolves the futures-channel dependency to a version < 0.3.29, this causes a build failure:

error[E0599]: no method named `is_empty` found for struct `UnboundedSender` in the current scope
  --> [snip]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-core-0.6.0-alpha.2/src/reactive_context.rs:65:20
   |
65 |             if !tx.is_empty() {
   |                    ^^^^^^^^ method not found in `UnboundedSender<_>`

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

Environment:

Questionnaire

dan-arnold commented 1 month ago

I tried bumping to the latest version of futures-channel, 0.31.0, ran all the tests described in the contribution guide, and everything builds successfully and passes. I can make a PR if you'd like.

ealmloff commented 1 month ago

I tried bumping to the latest version of futures-channel, 0.31.0, ran all the tests described in the contribution guide, and everything builds successfully and passes. I can make a PR if you'd like.

That would be great!