Skip to content

Default features usage in dioxus precludes disabling tokio_runtime #4087

@Jaltaire

Description

@Jaltaire

When adding dioxus as a dependency, dioxus-desktop is configured in dioxus/Cargo.toml as:

dioxus-desktop = { workspace = true, default-features = true, optional = true }

and because Cargo features are additive, this precludes tokio_runtime from being later disabled.

(As such, I am currently using a fork of Dioxus with default-features = false for dioxus-desktop, and this resolves the tokio runtime problem as expected: Jaltaire@6d3d3e9.)

Not sure what the preferred/idiomatic way would be to better handle this, but a couple ideas:

  • We can set default-features = false (or remove tokio_runtime as a default feature) in dioxus/Cargo.toml, though this may be less than preferable for those who ordinarily do not need to set up a separate tokio runtime (as seems to be the expectation for most Dioxus users).
  • Could add setup of tokio runtime to the LaunchBuilder instead.

Happy to put together a PR once there's some consensus around a preferred solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions