|
| 1 | +# Migrating to 0.16.0 |
| 2 | + |
| 3 | +## https://github.com/makspll/bevy_mod_scripting/pull/455 |
| 4 | +Replace all usages of `CallbackSettings<P>.callback_handler` with `P::handler()(..)` and `P::handle(..)` |
| 5 | + |
| 6 | +## https://github.com/makspll/bevy_mod_scripting/pull/456 |
| 7 | +Replace all usages of `CallbackBuilder<P>.load` and `CallbackBuilder<P>.reload` with `P::load(..)` and `P::reload(..)` or `P::context_loader()(..)` and `P::context_reloader()(..)` |
| 8 | + |
| 9 | +## https://github.com/makspll/bevy_mod_scripting/pull/463 |
| 10 | +If you were relying on BMS enabling some features in Bevy crates, your builds might be pulling in less features than you expect. Ensure you explicitly select all features you need from bevy. BMS will now only pull in strictly necessary features and crates from bevy |
| 11 | + |
| 12 | +## https://github.com/makspll/bevy_mod_scripting/pull/470 |
| 13 | +Switch all references of `ContextLoadingSettings` to `P::readonly_config(world.id())`. |
| 14 | + |
| 15 | +## https://github.com/makspll/bevy_mod_scripting/pull/471 |
| 16 | +`RuntimeSettings` and `RuntimeContainer` are removed, replace usages with `P::readonly_settings(world.id()).runtime)` access to initializers is no longer possible outside the plugin setup phase |
| 17 | + |
| 18 | +## https://github.com/makspll/bevy_mod_scripting/pull/472 |
| 19 | +if you implemented a scripting plugin you will need to correct your function signatures for the above aliases, and fetch the config yourself to access callbacks via `Plugin::readonly_configuration(world_id)` using the world id you will now receive. |
| 20 | + |
| 21 | +## https://github.com/makspll/bevy_mod_scripting/pull/473 |
| 22 | +references to `StaticScripts` should be replaced with appropriate resident calls on `ScriptContext` filtered by the attachment kind |
| 23 | + |
| 24 | +## https://github.com/makspll/bevy_mod_scripting/pull/474 |
| 25 | +- **ScriptContext Access**: Use `.read()` and `.write()` to access ScriptContext (now wrapped in `Arc<RwLock<>>`); replace `get()` with `get_context()` |
| 26 | +- **HandlerContext**: Replace with direct ScriptContext access; remove any `with_handler_system_state()` calls |
| 27 | +- **Script Callbacks**: Use new `call_context_dynamic()` or `call_context()` methods from the CallContext trait |
| 28 | +- **Custom Context Types**: Implement the new `GetPluginFor` trait to provide mapping from context to plugin type |
| 29 | +- **Lua Interaction**: Replace `mlua::Lua` with `LuaContext` wrapper type in all Lua code on BMS side |
| 30 | +- **Script Callback Running**: Replace `run_with_handler()` calls with `run_with_context()` or `run_with_contexts()` |
| 31 | + |
| 32 | +## https://github.com/makspll/bevy_mod_scripting/pull/475 |
| 33 | +- References previously resident in `bevy_mod_scripting_core::asset`/`bevy_mod_scripting::core::asset` will now need to come from `bevy_mod_scripting_asset` or `bevy_mod_scripting::asset` |
| 34 | +- Adding supported extensions will now need to be done via `scripting_plugin.add_supported_extension("extension")` rather than via the app directly |
| 35 | +- Plugin implementors will need to add the new crate as a dependency and should not directly rely on the top workspace crate |
| 36 | + |
| 37 | +## https://github.com/makspll/bevy_mod_scripting/pull/477 |
| 38 | +- Update imports to new crates (`bevy_mod_scripting_bindings`, `bevy_mod_scripting_display`, `bevy_mod_scripting_asset`) where appropriate, if you rely on the workspace these will be re-exported under `bindings`, `display` and `asset` respectively |
| 39 | +- Replace `DisplayWithWorld` usage with `DisplayWithTypeInfo` / `DebugWithTypeInfo` and use `WithTypeInfo::new(value)` in format strings. Ensure that the WorldGuard is in scope when printing using these utilities, or you might see raw type id's |
0 commit comments