cBournhonesque / lightyear

A networking library to make multiplayer games for the Bevy game engine
https://cbournhonesque.github.io/lightyear/book
Apache License 2.0
496 stars 51 forks source link

Enabling the `leafwing` feature adds 100 extra dependencies #669

Closed vladbat00 closed 1 month ago

vladbat00 commented 1 month ago

Here's a minimal example of Cargo.toml to reproduce the issue:

[package]
name = "test_deps"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = { version = "0.14.2", default-features = false }
leafwing-input-manager = { version = "0.15.1", default-features = false }
lightyear = { version = "0.17.1", default-features = false }

^ This is a minimal setup that is needed to implement a headless Bevy app. It brings in ~200 crates (which is without the 100 extra).

But if we enable the leafwing feature like that: lightyear = { version = "0.17.1", default-features = false, features = ["leafwing"] } - cargo will now have to compile 309 dependencies.

I think the issue is that lightyear brings in leafwing-input-manager with default features enabled. But I'm not sure if they are all actually needed. The added crates include bevy_render, for example, which is not ideal for a headless app.

Is it possible to disable default features for leafwing-input-manager? I guess we still need to verify that lightyear doesn't indeed need them.