From c4991e2f2866b2c1b0a14edc3ddf3699f47ef13d Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Sun, 23 Feb 2025 12:21:36 +0000 Subject: [PATCH 1/2] Create 0.9.7.md --- release-notes/0.9.7.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 release-notes/0.9.7.md diff --git a/release-notes/0.9.7.md b/release-notes/0.9.7.md new file mode 100644 index 0000000000..8ad3305c81 --- /dev/null +++ b/release-notes/0.9.7.md @@ -0,0 +1,29 @@ +# [`bevy_mod_scripting`](https://github.com/makspll/bevy_mod_scripting/) 0.9.7 is out! + +![image](https://github.com/user-attachments/assets/6ae0f927-ea1b-4d90-a809-4cc513e49b18) + +## Summary +- Adds macro for generating namespace builder instantiations including docstrings and argument names like so: +```rust +#[script_bindings(name = "test_functions")] +impl TestStruct { + /// My docs !! + fn test_fn(_self: Ref, mut _arg1: usize) {} +} + +fn main() { + let mut world = ... + register_test_functions(&mut world); +} +``` +- Fixes compilation issues with `tracy` enabled +- Initial work on `Language Agnostic Declaration` (LAD) file format for doc-gen +- Adds ability to create static scripts, which do not need to be attached to an entity to run: +```rust +commands.queue(AddStaticScript::new("my_static_script.lua")); +``` +- Fixes asset loader issues (asset loaders now specify extensions) when working with `bevy_asset_loader` and other asset loading crates +- And more + +## Changelog +See a detailed changelog [here](https://github.com/makspll/bevy_mod_scripting/blob/main/CHANGELOG.md) From 15f8b7676e8513f0ea811ab64c05c5f6224cf82b Mon Sep 17 00:00:00 2001 From: Maksymilian Mozolewski Date: Sun, 23 Feb 2025 12:35:24 +0000 Subject: [PATCH 2/2] Update 0.9.7.md --- release-notes/0.9.7.md | 54 +++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/release-notes/0.9.7.md b/release-notes/0.9.7.md index 8ad3305c81..ce7ca0217f 100644 --- a/release-notes/0.9.7.md +++ b/release-notes/0.9.7.md @@ -3,27 +3,47 @@ ![image](https://github.com/user-attachments/assets/6ae0f927-ea1b-4d90-a809-4cc513e49b18) ## Summary -- Adds macro for generating namespace builder instantiations including docstrings and argument names like so: +- Adds ability to construct arbitrary types and enums via `construct` global functions: +```lua +local myStruct = construct(StructType, { + foo = bar + zoo = construct(NestedType { + foo = bar + }) +}) + +local myEnum = construct(EnumType, { + variant = "StructVariant" + foo = Bar +}) + +local myTupleStructEnum = construct(EnumType, { + variant = "TupleStructVariant" + _1 = bar +}) +``` + +- BMS will now automatically register components with `ReflectComponent` type data, so that you can query them as components *before* inserting them into entities. i.e.: ```rust -#[script_bindings(name = "test_functions")] -impl TestStruct { - /// My docs !! - fn test_fn(_self: Ref, mut _arg1: usize) {} -} - -fn main() { - let mut world = ... - register_test_functions(&mut world); -} +#[derive(Reflect, ..)] +#[reflect(Component)] +struct MyComp; ``` -- Fixes compilation issues with `tracy` enabled -- Initial work on `Language Agnostic Declaration` (LAD) file format for doc-gen -- Adds ability to create static scripts, which do not need to be attached to an entity to run: + +- `ReflectAllocator` diagnostics are now available conveniently packaged as a plugin (measuring current allocation count + deallocations): ```rust -commands.queue(AddStaticScript::new("my_static_script.lua")); +app.add_plugins(AllocatorDiagnosticPlugin) ``` -- Fixes asset loader issues (asset loaders now specify extensions) when working with `bevy_asset_loader` and other asset loading crates -- And more + +- Initial documentation generation from LAD files is now being published with the book over at https://makspll.github.io/bevy_mod_scripting/ladfiles/bindings.lad.html + - This is still a prototype, but will contain useful information on bindings BMS exports by default. + - LAD files are in a good shape, but some details need to be polished before they become stable + - work on other backends (other than mdbook) should be possible now, albeit changes are expected + +## Fixes +- When an asset handle is requested and immediately dropped, the previously confusing error: `A script was added but it's asset was not found, failed to compute metadata. This script will not be loaded.` was downgraded to a warning with a helpful hint. +- Cases where resource/component/allocation locks would not be correctly released in the case of script function errors or short-circuting logic were fixed +- The `bevy/reflect_functions` and `bevy/file_watcher` feature flags are no longer pulled into the dependency tree by BMS, reducing bloat. ## Changelog See a detailed changelog [here](https://github.com/makspll/bevy_mod_scripting/blob/main/CHANGELOG.md)