[Merged by Bors] - docs: Full documentation for bevy_asset#3536
[Merged by Bors] - docs: Full documentation for bevy_asset#3536manokara wants to merge 32 commits intobevyengine:mainfrom
Conversation
|
#3348 is also adding some docs in bevy_assets |
|
Oh, and it's more detailed than mine! I just focused on giving them short summaries for the coverage. We should merge that one first and I'll rebase my work on top of it. |
|
Awesome. I'll work on getting #3348 merged now then. |
ff11545 to
a074e17
Compare
d9282bb to
19dbc04
Compare
|
All is done! Now the PR is up for full review. Everything is documented except for things that are self-expanatory, such as There were a few code changes:
Each one was made as a separate commit, so if they're out of scope for this PR it'll be easy to revert them. |
crates/bevy_asset/src/diagnostic/asset_count_diagnostics_plugin.rs
Outdated
Show resolved
Hide resolved
alice-i-cecile
left a comment
There was a problem hiding this comment.
These are really solid: detailed and technical but covering how and why you may want to use these.
I have a few nits, and want to chat a bit more about the as_weak vs cast decision.
|
I was thinking of renaming |
Yes please. |
|
Migration Guide:
|
|
All done! I reverted the breaking changes as @alice-i-cecile suggested, but kept the |
|
@bevyengine/docs-team I would really like to land this for 0.8. |
IceSentry
left a comment
There was a problem hiding this comment.
I didn't review everything with a lot of details but it all seemed pretty good.
|
Did a final review pass, everything checks out :) Thanks y'all! bors r+ |
# Objective
This PR aims to document the `bevy_asset` crate to complete coverage, while also trying to improve some bits of UX.
### Progress
- [x] Root items
- [x] `handle` module
- [x] `info` module
- [x] `path` module
- [x] `loader` module
- [x] `io` and `filesystem_watcher` module
- [x] `assets` module
- [x] `asset_server` module
- [x] `diagnostic` module
- [x] `debug_asset_server` module
- [x] Crate level documentation
- [x] Add `#![warn(missing_docs)]` lint
Coverage: 100%
## Migration Guide
- Rename `FileAssetIo::get_root_path` uses to `FileAssetIo::get_base_path`
`FileAssetIo::root_path()` is a getter for the `root_path` field, while `FileAssetIo::get_root_path` returned the parent directory of the asset root path, which was the executable's directory unless `CARGO_MANIFEST_DIR` was set. This change solves the ambiguity between the two methods.
# Objective - `#![warn(missing_docs)]` was added to bevy_asset in #3536 - A method was not documented when targeting wasm ## Solution - Add documentation for it
# Objective
This PR aims to document the `bevy_asset` crate to complete coverage, while also trying to improve some bits of UX.
### Progress
- [x] Root items
- [x] `handle` module
- [x] `info` module
- [x] `path` module
- [x] `loader` module
- [x] `io` and `filesystem_watcher` module
- [x] `assets` module
- [x] `asset_server` module
- [x] `diagnostic` module
- [x] `debug_asset_server` module
- [x] Crate level documentation
- [x] Add `#![warn(missing_docs)]` lint
Coverage: 100%
## Migration Guide
- Rename `FileAssetIo::get_root_path` uses to `FileAssetIo::get_base_path`
`FileAssetIo::root_path()` is a getter for the `root_path` field, while `FileAssetIo::get_root_path` returned the parent directory of the asset root path, which was the executable's directory unless `CARGO_MANIFEST_DIR` was set. This change solves the ambiguity between the two methods.
# Objective - `#![warn(missing_docs)]` was added to bevy_asset in bevyengine#3536 - A method was not documented when targeting wasm ## Solution - Add documentation for it
# Objective
This PR aims to document the `bevy_asset` crate to complete coverage, while also trying to improve some bits of UX.
### Progress
- [x] Root items
- [x] `handle` module
- [x] `info` module
- [x] `path` module
- [x] `loader` module
- [x] `io` and `filesystem_watcher` module
- [x] `assets` module
- [x] `asset_server` module
- [x] `diagnostic` module
- [x] `debug_asset_server` module
- [x] Crate level documentation
- [x] Add `#![warn(missing_docs)]` lint
Coverage: 100%
## Migration Guide
- Rename `FileAssetIo::get_root_path` uses to `FileAssetIo::get_base_path`
`FileAssetIo::root_path()` is a getter for the `root_path` field, while `FileAssetIo::get_root_path` returned the parent directory of the asset root path, which was the executable's directory unless `CARGO_MANIFEST_DIR` was set. This change solves the ambiguity between the two methods.
# Objective - `#![warn(missing_docs)]` was added to bevy_asset in bevyengine#3536 - A method was not documented when targeting wasm ## Solution - Add documentation for it
# Objective Following discussion on #3536 and #3522, `Handle::as_weak()` takes a type `U`, reinterpreting the handle as of another asset type while keeping the same ID. This is mainly used today in font atlas code. This PR does two things: - Rename the method to `cast_weak()` to make its intent more clear - Actually change the type uuid in the handle if it's not an asset path variant. ## Migration Guide - Rename `Handle::as_weak` uses to `Handle::cast_weak` The method now properly sets the associated type uuid if the handle is a direct reference (e.g. not a reference to an `AssetPath`), so adjust you code accordingly if you relied on the previous behavior.
# Objective
This PR aims to document the `bevy_asset` crate to complete coverage, while also trying to improve some bits of UX.
### Progress
- [x] Root items
- [x] `handle` module
- [x] `info` module
- [x] `path` module
- [x] `loader` module
- [x] `io` and `filesystem_watcher` module
- [x] `assets` module
- [x] `asset_server` module
- [x] `diagnostic` module
- [x] `debug_asset_server` module
- [x] Crate level documentation
- [x] Add `#![warn(missing_docs)]` lint
Coverage: 100%
## Migration Guide
- Rename `FileAssetIo::get_root_path` uses to `FileAssetIo::get_base_path`
`FileAssetIo::root_path()` is a getter for the `root_path` field, while `FileAssetIo::get_root_path` returned the parent directory of the asset root path, which was the executable's directory unless `CARGO_MANIFEST_DIR` was set. This change solves the ambiguity between the two methods.
# Objective - `#![warn(missing_docs)]` was added to bevy_asset in bevyengine#3536 - A method was not documented when targeting wasm ## Solution - Add documentation for it
# Objective Following discussion on bevyengine#3536 and bevyengine#3522, `Handle::as_weak()` takes a type `U`, reinterpreting the handle as of another asset type while keeping the same ID. This is mainly used today in font atlas code. This PR does two things: - Rename the method to `cast_weak()` to make its intent more clear - Actually change the type uuid in the handle if it's not an asset path variant. ## Migration Guide - Rename `Handle::as_weak` uses to `Handle::cast_weak` The method now properly sets the associated type uuid if the handle is a direct reference (e.g. not a reference to an `AssetPath`), so adjust you code accordingly if you relied on the previous behavior.
Objective
This PR aims to document the
bevy_assetcrate to complete coverage, while also trying to improve some bits of UX.Progress
handlemoduleinfomodulepathmoduleloadermoduleioandfilesystem_watchermoduleassetsmoduleasset_servermodulediagnosticmoduledebug_asset_servermodule#![warn(missing_docs)]lintCoverage: 100%
Migration Guide
Rename
FileAssetIo::get_root_pathuses toFileAssetIo::get_base_pathFileAssetIo::root_path()is a getter for theroot_pathfield, whileFileAssetIo::get_root_pathreturned the parent directory of the asset root path, which was the executable's directory unlessCARGO_MANIFEST_DIRwas set. This change solves the ambiguity between the two methods.