bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Remove `AssetServer::watch_for_changes()`

Open irate-devil opened this issue 1 year ago • 1 comments

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.

app // AssetServerSettings must be inserted before adding the AssetPlugin or DefaultPlugins.
	.insert_resource(AssetServerSettings {
		watch_for_changes: true,
		..default()
	})

irate-devil avatar Sep 12 '22 19:09 irate-devil

could we have a method so that enabling hot reloading doesn't require 4 lines of boilerplate?

It's tempting to add a method like that, but then it becomes awkward when trying to set other settings, requiring a refactor.

Maybe consider deprecating?

Francois argues that we should just break things. It makes sense to me to avoid the maintenance cost of deprecation :)

irate-devil avatar Sep 12 '22 20:09 irate-devil

bors r+

alice-i-cecile avatar Sep 19 '22 15:09 alice-i-cecile

Build failed (retrying...):

bors[bot] avatar Sep 19 '22 16:09 bors[bot]

Build failed (retrying...):

bors[bot] avatar Sep 19 '22 16:09 bors[bot]