Skip to content

Conversation

@andriyDev
Copy link
Contributor

Objective

  • Fix cargo t -p bevy_asset --all-features.
    • Note: all-features do not run on CI!
  • The doc tests for the WebAssetPlugin don't compile at all. There are bad imports and we don't even add the AssetPlugin.

Solution

  • Add missing imports, and add missing plugins to the App.

Testing

  • Ran cargo t -p bevy_asset --all-features and it passes now!

@andriyDev andriyDev added D-Trivial Nice and easy! A great choice to get started with Bevy A-Assets Load files from disk to use for things like images, models, and sounds C-Testing A change that impacts how we test Bevy or how users test their apps S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 28, 2025
@james7132 james7132 changed the title Remove all the unused doc test stuff for the WebAssetPlugin. Fix the doc test for WebAssetPlugin Nov 28, 2025
/// # impl Sprite { fn from_image(_: Handle<Image>) -> Self { Sprite } }
/// # fn main() {
/// App::new()
/// # .add_plugins((TaskPoolPlugin::default(), AssetPlugin::default()))
Copy link
Contributor

@kfc35 kfc35 Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s a comment on line 14 that says:
"/// NOTE: Make sure to add this plugin *before* AssetPlugin to properly register http asset sources.”
Does this line contradict that statement? The App is now adding WebAssetPlugin later than AssetPlugin if I’m interpreting this correctly

/// # fn main() {
/// App::new()
/// # .add_plugins((TaskPoolPlugin::default(), AssetPlugin::default()))
/// # .init_asset::<Image>()
Copy link
Contributor

@kfc35 kfc35 Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d also assume you’d init the asset after adding the WebAssetPlugin… but I may be mistaken!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds C-Testing A change that impacts how we test Bevy or how users test their apps D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants