Skip to content
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

[Merged by Bors] - Add warning when using load_folder on web #5827

Closed
wants to merge 1 commit into from

Conversation

rparrett
Copy link
Contributor

@rparrett rparrett commented Aug 29, 2022

Objective

Help users who are using load_folder in wasm builds to find a slightly shorter path to figuring out why their stuff is broken.

Solution

Adds a warning to read_directory in the WasmAssetIo.

This is extremely similar to the warning already emitted a few lines below for watch_for_changes.

@mockersf mockersf added A-Assets Load files from disk to use for things like images, models, and sounds O-Web Specific to web (WASM) builds labels Aug 29, 2022
@@ -52,6 +52,7 @@ impl AssetIo for WasmAssetIo {
&self,
_path: &Path,
) -> Result<Box<dyn Iterator<Item = PathBuf>>, AssetIoError> {
bevy_log::warn!("Loading folders is not supported in WASM");
Copy link
Contributor

Choose a reason for hiding this comment

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

To keep in line with the name of the method

Suggested change
bevy_log::warn!("Loading folders is not supported in WASM");
bevy_log::warn!("Reading a directory is not supported in WASM");

Copy link
Contributor Author

@rparrett rparrett Aug 29, 2022

Choose a reason for hiding this comment

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

I thought that this phrasing would be more useful to normal users who would see this message when attempting to use load_folder.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, I guess that makes sense then since it's probably going to be the more common use case

@cart
Copy link
Member

cart commented Aug 29, 2022

bors r+

bors bot pushed a commit that referenced this pull request Aug 29, 2022
# Objective

Help users who are using `load_folder` in wasm builds to find a slightly shorter path to figuring out why their stuff is broken.

## Solution

Adds a warning to `read_directory` in the `WasmAssetIo`.

This is extremely similar to the warning already emitted a few lines below for `watch_for_changes`.
@bors bors bot changed the title Add warning when using load_folder on web [Merged by Bors] - Add warning when using load_folder on web Aug 29, 2022
@bors bors bot closed this Aug 29, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# Objective

Help users who are using `load_folder` in wasm builds to find a slightly shorter path to figuring out why their stuff is broken.

## Solution

Adds a warning to `read_directory` in the `WasmAssetIo`.

This is extremely similar to the warning already emitted a few lines below for `watch_for_changes`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

Help users who are using `load_folder` in wasm builds to find a slightly shorter path to figuring out why their stuff is broken.

## Solution

Adds a warning to `read_directory` in the `WasmAssetIo`.

This is extremely similar to the warning already emitted a few lines below for `watch_for_changes`.
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 O-Web Specific to web (WASM) builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants