-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration to automatically disable/enable features when running in the web #250
Comments
We can take the One challenge will be that there are four useful configurations:
and possible the overarching ones (for all, for native, for web). The |
Another idea: We introduce "magic" feature flags, similar to the "magic" So if the user runs Advantages
Disadvantages
|
# Objective Closes #297. This PR prepares the project to use the Bevy CLI, mainly the `bevy run` command. It simplifies especially running for the web target, which previously required use of `trunk` (and a bunch of additional configuration). # Solution - Remove custom web assets. Use the defaults provided by Bevy CLI instead. - Remove custom compilation profiles for the web build. The CLI will automatically use custom `web` and `web-release` profiles which use sensible defaults for web builds. - Adjust the release CI workflow to use the Bevy CLI with `--bundle` instead of `trunk`. - Update the README to use Bevy CLI instead of `trunk`. Note that this introduces a "regression" to the user that they now have to specify `--no-default-features`, which was automatically passed to `trunk`. I created <TheBevyFlock/bevy_cli#250> so we can do that in Bevy CLI as well. # Testing 1. Install the Bevy CLI: ``` cargo install --git https://github.com/TheBevyFlock/bevy_cli --locked bevy_cli ``` 2. Checkout this branch: `gh pr checkout 312` (with the GitHub CLI) 3. Run the app in the browser: ``` bevy run --no-default-features web --open ``` --------- Co-authored-by: Ben Frankel <[email protected]>
We should provide an option to automatically disable default features and enable features when running the app on the web.
For example, via a
package.metadata.bevy_cli.web.default-features = false
configuration inCargo.toml
.Use case: Some features, like file watching, are only available on native platforms.
It's convenient to have them enabled by default, so that
cargo run
gives you hot asset reloading.But then we have to always add
--no-default-features
when runningbevy run web
, which is a regression in TheBevyFlock/bevy_new_2d#312.It would be nice if we could permanently configure it instead so the user doesn't have to type it out every time.
CLI options should take precedence over the
Cargo.toml
configuration.The text was updated successfully, but these errors were encountered: