bevy/crates
Carter Anderson fa903a122f
AssetMetaMode (#10623)
# Objective

Fixes #10157

## Solution

Add `AssetMetaCheck` resource which can configure when/if asset meta
files will be read:

```rust
app
  // Never attempts to look up meta files. The default meta configuration will be used for each asset.
  .insert_resource(AssetMetaCheck::Never)
  .add_plugins(DefaultPlugins)
```


This serves as a band-aid fix for the issue with wasm's
`HttpWasmAssetReader` creating a bunch of requests for non-existent
meta, which can slow down asset loading (by waiting for the 404
response) and creates a bunch of noise in the logs. This also provides a
band-aid fix for the more serious issue of itch.io deployments returning
403 responses, which results in full failure of asset loads.

If users don't want to include meta files for all deployed assets for
web builds, and they aren't using meta files at all, they should set
this to `AssetMetaCheck::Never`.

If users do want to include meta files for specific assets, they can use
`AssetMetaCheck::Paths`, which will only look up meta for those paths.

Currently, this defaults to `AssetMetaCheck::Always`, which makes this
fully non-breaking for the `0.12.1` release. _**However it _is_ worth
discussing making this `AssetMetaCheck::Never` by default**_, given that
I doubt most people are using meta files without the Asset Processor
enabled. This would be a breaking change, but it would make WASM / Itch
deployments work by default, which is a pretty big win imo. The downside
is that people using meta files _without_ processing would need to
manually enable `AssetMetaCheck::Always`, which is also suboptimal.

When in `AssetMetaCheck::Processed`, the meta check resource is ignored,
as processing requires asset meta files to function.

In general, I don't love adding this knob as things should ideally "just
work" in all cases. But this is the reality of the current situation.

---

## Changelog

- Added `AssetMetaCheck` resource, which can configure when/if asset
meta files will be read
2023-11-27 22:32:36 +00:00
..
bevy_a11y Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_animation Enable clippy::undocumented_unsafe_blocks warning across the workspace (#10646) 2023-11-21 02:06:24 +00:00
bevy_app Wait until FixedUpdate can see events before dropping them (#10077) 2023-11-26 23:04:41 +00:00
bevy_asset AssetMetaMode (#10623) 2023-11-27 22:32:36 +00:00
bevy_audio Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_core Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_core_pipeline impl From<Color> for ClearColorConfig (#10734) 2023-11-26 20:48:03 +00:00
bevy_derive Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_diagnostic Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_dylib Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_dynamic_plugin Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_ecs Copy over docs for Condition trait from PR #10718 (#10748) 2023-11-27 16:33:22 +00:00
bevy_ecs_compile_fail_tests Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_encase_derive Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_gilrs Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
bevy_gizmos move gizmo arcs to their own file (#10660) 2023-11-22 14:58:34 +00:00
bevy_gltf Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_hierarchy Make bevy_app and reflect opt-out for bevy_hierarchy. (#10721) 2023-11-25 03:05:38 +00:00
bevy_input Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_internal Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_log Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_macro_utils Allow #[derive(Bundle)] on tuple structs (take 3) (#10561) 2023-11-21 01:09:16 +00:00
bevy_macros_compile_fail_tests Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_math Use minor and major radii for Torus primitive shape (#10643) 2023-11-21 01:49:35 +00:00
bevy_mikktspace Enable clippy::undocumented_unsafe_blocks warning across the workspace (#10646) 2023-11-21 02:06:24 +00:00
bevy_pbr Use as_image_copy where possible (#10733) 2023-11-26 19:24:32 +00:00
bevy_ptr Enable clippy::undocumented_unsafe_blocks warning across the workspace (#10646) 2023-11-21 02:06:24 +00:00
bevy_reflect bevy_utils: Export generate_composite_uuid utility function (#10496) 2023-11-25 23:21:35 +00:00
bevy_reflect_compile_fail_tests Improve TypeUuid's derive macro error messages (#9315) 2023-10-02 12:42:01 +00:00
bevy_render Add wgpu_pass method to TrackedRenderPass (#10722) 2023-11-25 03:11:24 +00:00
bevy_scene Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_sprite Use as_image_copy where possible (#10733) 2023-11-26 19:24:32 +00:00
bevy_tasks bump bevy_tasks futures-lite to 2.0.1 (#10675) 2023-11-24 00:11:02 +00:00
bevy_text Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_time Wait until FixedUpdate can see events before dropping them (#10077) 2023-11-26 23:04:41 +00:00
bevy_transform Enable clippy::undocumented_unsafe_blocks warning across the workspace (#10646) 2023-11-21 02:06:24 +00:00
bevy_ui Fix typo in resolve_outlines_system (#10730) 2023-11-25 14:23:17 +00:00
bevy_utils bevy_utils: Export generate_composite_uuid utility function (#10496) 2023-11-25 23:21:35 +00:00
bevy_window add new event WindowOccluded from winit (#10735) 2023-11-26 21:58:54 +00:00
bevy_winit add new event WindowOccluded from winit (#10735) 2023-11-26 21:58:54 +00:00