-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] - Remove AssetServer::watch_for_changes()
#5968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but could we have a
impl AssetServerSettings {
fn hot_reloading() -> Self { Self { watch_for_changes: true, ..default } }
}
method so that enabling hot reloading doesn't require 4 lines of boilerplate?
Maybe consider deprecating?
examples/shader/post_processing.rs
Outdated
let mut app = App::new(); | ||
app.add_plugins(DefaultPlugins) | ||
App::new() | ||
.insert_resource(AssetServerSettings { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this example actually needs this. It's not necessary to showcase post_processing. I think people should just add it manually if they want to play with it. Otherwise we might as well just add it to all examples with assets.
Same thing applies for the shader_instancing example
It's tempting to add a method like that, but then it becomes awkward when trying to set other settings, requiring a refactor.
Francois argues that we should just break things. It makes sense to me to avoid the maintenance cost of deprecation :) |
bors r+ |
# Objective `AssetServer::watch_for_changes()` is racy and redundant with `AssetServerSettings`. Closes #5964. ## Changelog * Remove `AssetServer::watch_for_changes()` * Add `AssetServerSettings` to the prelude. * Minor cleanup. ## Migration Guide `AssetServer::watch_for_changes()` was removed. Instead, use the `AssetServerSettings` resource. ```rust app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins. .insert_resource(AssetServerSettings { watch_for_changes: true, ..default() }) ``` Co-authored-by: devil-ira <[email protected]>
Build failed (retrying...): |
# Objective `AssetServer::watch_for_changes()` is racy and redundant with `AssetServerSettings`. Closes #5964. ## Changelog * Remove `AssetServer::watch_for_changes()` * Add `AssetServerSettings` to the prelude. * Minor cleanup. ## Migration Guide `AssetServer::watch_for_changes()` was removed. Instead, use the `AssetServerSettings` resource. ```rust app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins. .insert_resource(AssetServerSettings { watch_for_changes: true, ..default() }) ``` Co-authored-by: devil-ira <[email protected]>
Build failed (retrying...): |
# Objective `AssetServer::watch_for_changes()` is racy and redundant with `AssetServerSettings`. Closes #5964. ## Changelog * Remove `AssetServer::watch_for_changes()` * Add `AssetServerSettings` to the prelude. * Minor cleanup. ## Migration Guide `AssetServer::watch_for_changes()` was removed. Instead, use the `AssetServerSettings` resource. ```rust app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins. .insert_resource(AssetServerSettings { watch_for_changes: true, ..default() }) ``` Co-authored-by: devil-ira <[email protected]>
Pull request successfully merged into main. Build succeeded: |
AssetServer::watch_for_changes()
AssetServer::watch_for_changes()
# Objective `AssetServer::watch_for_changes()` is racy and redundant with `AssetServerSettings`. Closes bevyengine#5964. ## Changelog * Remove `AssetServer::watch_for_changes()` * Add `AssetServerSettings` to the prelude. * Minor cleanup. ## Migration Guide `AssetServer::watch_for_changes()` was removed. Instead, use the `AssetServerSettings` resource. ```rust app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins. .insert_resource(AssetServerSettings { watch_for_changes: true, ..default() }) ``` Co-authored-by: devil-ira <[email protected]>
# Objective `AssetServer::watch_for_changes()` is racy and redundant with `AssetServerSettings`. Closes bevyengine#5964. ## Changelog * Remove `AssetServer::watch_for_changes()` * Add `AssetServerSettings` to the prelude. * Minor cleanup. ## Migration Guide `AssetServer::watch_for_changes()` was removed. Instead, use the `AssetServerSettings` resource. ```rust app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins. .insert_resource(AssetServerSettings { watch_for_changes: true, ..default() }) ``` Co-authored-by: devil-ira <[email protected]>
# Objective `AssetServer::watch_for_changes()` is racy and redundant with `AssetServerSettings`. Closes bevyengine#5964. ## Changelog * Remove `AssetServer::watch_for_changes()` * Add `AssetServerSettings` to the prelude. * Minor cleanup. ## Migration Guide `AssetServer::watch_for_changes()` was removed. Instead, use the `AssetServerSettings` resource. ```rust app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins. .insert_resource(AssetServerSettings { watch_for_changes: true, ..default() }) ``` Co-authored-by: devil-ira <[email protected]>
Objective
AssetServer::watch_for_changes()
is racy and redundant withAssetServerSettings
.Closes #5964.
Changelog
AssetServer::watch_for_changes()
AssetServerSettings
to the prelude.Migration Guide
AssetServer::watch_for_changes()
was removed.Instead, use the
AssetServerSettings
resource.