|
| 1 | +--- |
| 2 | +applyTo: docs/, **/*.md |
| 3 | +--- |
| 4 | + |
| 5 | +# Documentation Instructions |
| 6 | + |
| 7 | +The `/docs` folder contain documentation for the project as well as release notes. |
| 8 | + |
| 9 | +Newer release notes should be added to `/docs/src/ReleaseNotes/`. |
| 10 | + |
| 11 | +When making changes to the documentation, please ensure that you follow these guidelines: |
| 12 | +- Use clear and concise language, focusing on EXAMPLES and practical usage. |
| 13 | +- Use these naming conventions: |
| 14 | + - Use lowercase letters and hyphens for file names (e.g., `my-documentation-file.md`). |
| 15 | + - for migration guides use the format `0.0.1-to-0.0.2.md`. |
| 16 | + - for release notes use the format `0.0.1.md`. |
| 17 | + |
| 18 | + |
| 19 | +# Release Notes Instructions |
| 20 | + |
| 21 | +Release notes should highlight the major highlights of each release, while leaving the breaking changes for migration guides. |
| 22 | + |
| 23 | +When creating release notes, please follow these guidelines: |
| 24 | +- Include links to relevant issues or pull requests when applicable. |
| 25 | +- YOU MUST use the following heading structure: |
| 26 | + - `# Version - Short Description` |
| 27 | + - `## Summary` |
| 28 | + - `### <Theme>` for each major theme or change |
| 29 | + - `### Other Changes` (if applicable) for smaller changes worth mentioning |
| 30 | + - `## Migration Guide` (if applicable) providing a link to the detailed migration guide. |
| 31 | + |
| 32 | + |
| 33 | +# Migration Guide Instructions |
| 34 | + |
| 35 | +When creating migration guides, please follow these guidelines: |
| 36 | +- Provide step-by-step instructions for updating projects to the new version. |
| 37 | +- Each breaking change should come under a heading related to the change i.e. `### ScriptAsset removed` |
| 38 | +- Include code snippets to illustrate changes. |
| 39 | +- Use diff format when talking about concrete changes to specific structures or traits. |
| 40 | +- Include links to relevant issues or pull requests when applicable. |
| 41 | +- Generally each pull request has a migration guide section, which must be taken into account and expanded on when writing relevant migration guides. |
| 42 | + |
| 43 | + |
| 44 | +# Examples |
| 45 | + |
| 46 | +## Release Notes Example |
| 47 | + |
| 48 | +```markdown |
| 49 | +# 0.15.0 - Asset Handles and Context Policies |
| 50 | + |
| 51 | +This release focuses on aligning `bevy_mod_scripting` with modern Bevy practices, most notably by switching to `Handle<ScriptAsset>` for script management. This change simplifies the API, removes boilerplate, and makes script handling more idiomatic. |
| 52 | + |
| 53 | +## Summary |
| 54 | + |
| 55 | +### Asset-First Workflow |
| 56 | +Scripts are now treated as first-class Bevy assets. The old `ScriptId` (which was a string) has been replaced by `AssetId<ScriptAsset>`, and you'll primarily interact with scripts via `Handle<ScriptAsset>`. |
| 57 | + |
| 58 | +```rust,ignore |
| 59 | +// New way |
| 60 | +let handle: Handle<ScriptAsset> = asset_server.load("my_script.lua"); |
| 61 | +commands.spawn(ScriptComponent(vec![handle])); |
| 62 | +``` |
| 63 | + |
| 64 | +Scripts are now only evaluated when they are attached to a `ScriptComponent` or added to `StaticScripts`, which means you have more control over when and how scripts are executed. |
| 65 | + |
| 66 | +### Other Changes |
| 67 | +- **`Recipients` Enum:** The `Recipients` enum for events has been redesigned to align with the new context policies, offering `AllScripts` and `AllContexts` variants, and removing some variants which don't fit the new model. If you need the old behaviour, you can simply query the ECS first before sending events. |
| 68 | +- **API Cleanup:** Several types and traits were removed or simplified, including `ScriptAssetSettings`, `AssetPathToScriptIdMapper`, and `ScriptMetadataStore`, as they are no longer needed with the new asset-based approach. |
| 69 | + |
| 70 | +## Migration Guide |
| 71 | +This release contains significant breaking changes. Please refer to the migration guide for detailed instructions on updating your project. |
| 72 | + |
| 73 | +- [Migration Guide: 0.14 to 0.15](https://makspll.github.io/bevy_mod_scripting/Migration/0.14-to-0.15.html) |
| 74 | + |
| 75 | +``` |
| 76 | +
|
| 77 | +## Migration Guide Example |
| 78 | +
|
| 79 | +```markdown |
| 80 | +# Migration Guide: <from> to <to> |
| 81 | +
|
| 82 | +## Changes to pre handling callbacks |
| 83 | +
|
| 84 | +This change affects the parameters for the `context_pre_handling_initializers` |
| 85 | +```diff |
| 86 | +- context_pre_handling_initializers: vec![|script_id, entity, context| { |
| 87 | ++ context_pre_handling_initializers: vec![|context_key, context| { |
| 88 | +``` |
| 89 | +and `context_initializers`: |
| 90 | +```diff |
| 91 | +- context_initializers: vec![|script_id, context| { |
| 92 | ++ context_initializers: vec![|context_key, context| { |
| 93 | +``` |
| 94 | + |
| 95 | +``` |
0 commit comments