Skip to content

Conversation

makspll
Copy link
Owner

@makspll makspll commented Aug 30, 2025

Summary

Static scripts are now identified by the abscence of a ScriptComponent corresponding to the asset on any entity.

Migration Guide

references to StaticScripts should be replaced with appropriate resident calls on ScriptContext filtered by the attachment kind

Copy link

semanticdiff-com bot commented Aug 30, 2025

@makspll makspll enabled auto-merge (squash) August 30, 2025 10:05
@makspll makspll requested a review from Copilot August 30, 2025 10:12
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the scripting system by removing the StaticScripts resource and changing how static scripts are identified - they are now detected by the absence of a corresponding ScriptComponent on any entity.

  • Removes the StaticScripts resource and all associated methods
  • Updates static script identification logic to use entity component absence detection
  • Simplifies script handling by eliminating the dual attachment system

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/script_tests.rs Simplifies error handling in test executor
examples/game_of_life.rs Replaces StaticScripts resource with local vector for tracking
crates/languages/bevy_mod_scripting_lua/src/lib.rs Adds world configuration setup for test consistency
crates/bevy_mod_scripting_core/src/script/mod.rs Removes StaticScripts struct and all related functionality
crates/bevy_mod_scripting_core/src/lib.rs Updates plugin configuration and removes resource initialization
crates/bevy_mod_scripting_core/src/extractors.rs Removes static scripts handling from handler context
crates/bevy_mod_scripting_core/src/config.rs Renames configuration method for clarity
crates/bevy_mod_scripting_core/src/commands.rs Removes static script management from commands
crates/bevy_mod_scripting_core/src/asset.rs Updates script event handling to use entity-based detection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@makspll makspll disabled auto-merge August 30, 2025 10:14
Copy link
Contributor

🐰 Bencher Report

Branchrefactor/remove-static-scripts-resource
Testbedlinux-gha

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
component/access Lua📈 view plot
⚠️ NO THRESHOLD
3,443.90 ns
component/access Rhai📈 view plot
⚠️ NO THRESHOLD
5,542.50 ns
component/get Lua📈 view plot
⚠️ NO THRESHOLD
2,157.50 ns
component/get Rhai📈 view plot
⚠️ NO THRESHOLD
4,301.90 ns
conversions/Mut::from📈 view plot
⚠️ NO THRESHOLD
84.42 ns
conversions/Ref::from📈 view plot
⚠️ NO THRESHOLD
80.35 ns
conversions/ScriptValue::List📈 view plot
⚠️ NO THRESHOLD
282.53 ns
conversions/ScriptValue::Map📈 view plot
⚠️ NO THRESHOLD
903.95 ns
conversions/ScriptValue::Reference::from_into📈 view plot
⚠️ NO THRESHOLD
25.80 ns
conversions/Val::from_into📈 view plot
⚠️ NO THRESHOLD
246.32 ns
function/call 4 args Lua📈 view plot
⚠️ NO THRESHOLD
1,560.40 ns
function/call 4 args Rhai📈 view plot
⚠️ NO THRESHOLD
1,310.90 ns
function/call Lua📈 view plot
⚠️ NO THRESHOLD
223.52 ns
function/call Rhai📈 view plot
⚠️ NO THRESHOLD
420.71 ns
loading/empty Lua📈 view plot
⚠️ NO THRESHOLD
52,620.00 ns
loading/empty Rhai📈 view plot
⚠️ NO THRESHOLD
299,800.00 ns
math/vec mat ops Lua📈 view plot
⚠️ NO THRESHOLD
6,878.70 ns
math/vec mat ops Rhai📈 view plot
⚠️ NO THRESHOLD
6,018.00 ns
query/10 entities Lua📈 view plot
⚠️ NO THRESHOLD
17,667.00 ns
query/10 entities Rhai📈 view plot
⚠️ NO THRESHOLD
18,036.00 ns
query/100 entities Lua📈 view plot
⚠️ NO THRESHOLD
38,083.00 ns
query/100 entities Rhai📈 view plot
⚠️ NO THRESHOLD
29,169.00 ns
query/1000 entities Lua📈 view plot
⚠️ NO THRESHOLD
245,400.00 ns
query/1000 entities Rhai📈 view plot
⚠️ NO THRESHOLD
156,620.00 ns
reflection/10 Lua📈 view plot
⚠️ NO THRESHOLD
5,405.70 ns
reflection/10 Rhai📈 view plot
⚠️ NO THRESHOLD
15,239.00 ns
reflection/100 Lua📈 view plot
⚠️ NO THRESHOLD
46,718.00 ns
reflection/100 Rhai📈 view plot
⚠️ NO THRESHOLD
717,440.00 ns
resource/access Lua📈 view plot
⚠️ NO THRESHOLD
3,101.50 ns
resource/access Rhai📈 view plot
⚠️ NO THRESHOLD
5,171.90 ns
resource/get Lua📈 view plot
⚠️ NO THRESHOLD
1,837.70 ns
resource/get Rhai📈 view plot
⚠️ NO THRESHOLD
3,791.90 ns
🐰 View full continuous benchmarking report in Bencher

@makspll makspll enabled auto-merge (squash) August 30, 2025 10:51
@makspll makspll merged commit 416ee4d into main Aug 30, 2025
21 checks passed
@makspll makspll deleted the refactor/remove-static-scripts-resource branch August 30, 2025 11:38
@github-actions github-actions bot mentioned this pull request Aug 30, 2025
@github-actions github-actions bot mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant