mcpField
B
bevy-cargo-features

bevy-cargo-features

github.com/chrisgliddonDevelopment2692 installsUpdated 9w ago
Repository

About bevy-cargo-features

A Bevy 0.19 skill for developers selecting and combining Cargo features. It explains application profiles and lower-level options for headless servers, custom renderers, input, and browser builds.

Key features

  1. 01Application profile selection
  2. 02Feature collection overview
  3. 03Headless server configuration
  4. 04Custom renderer configuration
  5. 05Input and controller features
  6. 06Browser build profile

Use cases

  1. 01Trimming unused default features
  2. 02Configuring a headless server
  3. 03Building with a custom renderer
  4. 04Choosing browser and controller features

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/chrisgliddon/bevy-skills --skill bevy-cargo-features

After installing, type/bevy-cargo-featuresin Claude Code to confirm it loaded.

Details

From the project README

Bevy 0.19 — Cargo features

When to use this skill

  • Choose a supported application profile without enabling the full default set.
  • Compose a custom renderer or a headless server.
  • Enable native controller input, window/input APIs, or browser rendering.
  • Diagnose types/plugins missing after disabling default features.

Canonical profiles

Bevy's default is 2d + 3d + ui + audio. To select a profile, disabling defaults is essential:

# 3D game with Bevy UI, but no audio or 2D renderer
bevy = { version = "0.19", default-features = false, features = ["3d", "ui"] }

# 2D game with audio, but no 3D renderer or UI
# bevy = { version = "0.19", default-features = false, features = ["2d", "audio"] }

Writing features = ["3d"] while leaving default features enabled does not trim anything: Cargo unions feature sets.

Collection layers

LayerFeaturesMeaning
Profiles2d, 3d, ui, audioComplete app shapes
Built-in render2d_bevy_render, 3d_bevy_render, ui_bevy_renderBevy's renderer for one domain
API only2d_api, 3d_api, ui_apiComponents/assets without a render backend
Baselinedefault_app, default_platformCore app services vs platform/window/input services
Groupedscene, picking, devRelated feature collections

API-only features cannot draw. They are for custom/external renderers that consume Bevy's world-side types.

Headless server

bevy = { version = "0.19", default-features = false, features = [
    "default_app",
    "multi_threaded",
    "serialize",
    "bevy_world_serialization", # omit if the server never loads saved worlds
] }

Use MinimalPlugins, then add only the service plugins the server needs. bevy_scene is BSN in 0.19; classic reflected world serialization is bevy_world_serialization.

Custom renderer

bevy = { version = "0.19", default-features = false, features = [
    "default_app",
    "3d_api",
] }

Add bevy_winit/platform input only if the custom renderer shares Bevy's window event loop. Add 3d_bevy_render instead of 3d_api if you actually want Bevy's built-in renderer.

Input and controllers

  • mouse, keyboard, gamepad, touch, and gestures enable API pieces.
  • For native controller discovery/input, enable bevy_gilrs; it also enables gamepad. The gamepad feature alone is not the platform backend.
  • The high-level default_platform collection includes bevy_gilrs, Winit, desktop window backends, default font, and webgl2.

Browser profile

bevy = { version = "0.19", default-features = false, features = [
    "3d",
    "ui",
    "touch",
    # "webgpu", # overrides WebGL2; use a separate WebGPU artifact
] }

The 3d profile already includes the default platform and WebGL2 path. Enabling webgpu overrides webgl2; it is not a runtime fallback build. See bevy-wasm-webgpu.

0.19 implications and traps

  • 2d and 3d no longer imply ui; add ui explicitly.
  • 2d, 3d, and ui no longer imply audio; add audio or a lower-level codec combination explicitly.
  • scene now enables both bevy_world_serialization and the new BSN bevy_scene.
  • Keep dev, dynamic_linking, file watchers, tracing, and dev tools behind a project development feature; do not ship them accidentally.
  • Native Linux window backends are x11 and wayland; target-specific mobile activity features are mutually exclusive where documented. Do not invent windows or macos Bevy feature names.
  • Profile collections are the stable starting point. Use lower-level collections only when compile time, binary size, or a custom renderer makes the maintenance cost worthwhile.

See also

Comments

Markdown supported