Skip to content

Conversation

@newclarityex
Copy link
Contributor

@newclarityex newclarityex commented Feb 21, 2025

Objective

Prevents duplicate implementation between IntoSystemConfigs and IntoSystemSetConfigs using a generic, adds a NodeType trait for more config flexibility (opening the door to implement #14195?).

Solution

Followed writeup by @ItsDoot:
https://hackmd.io/@doot/rJeefFHc1x

Removes IntoSystemConfigs and IntoSystemSetConfigs, instead using IntoNodeConfigs with generics.

Testing

Pending


Showcase

N/A

Migration Guide

SystemSetConfigs -> ScheduleConfigs
SystemConfigs -> ScheduleConfigs
IntoSystemSetConfigs -> IntoScheduleConfigs<InternedSystemSet, M>
IntoSystemConfigs -> IntoScheduleConfigs<ScheduleSystem, M>

@newclarityex newclarityex marked this pull request as draft February 21, 2025 08:54
@ItsDoot ItsDoot self-requested a review February 21, 2025 08:57
@ItsDoot ItsDoot added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Feb 21, 2025
@newclarityex newclarityex marked this pull request as ready for review February 23, 2025 08:11
@ItsDoot ItsDoot added the M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Feb 23, 2025
Copy link
Contributor

@ItsDoot ItsDoot left a comment

Choose a reason for hiding this comment

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

First pass done! Good work so far!

However, one thing I don't mention below is that the impl_system_collection and impl_system_set_collection macros that provide implementations for tuples should be merged into a single impl_node_type_collection macro that uses a T: NodeType bound instead of hardcoding to ScheduleSystem or InternedSystemSet. It should be as simple as taking one of the macros, renaming it, adding the bounds, and using T in place of either of the aforementioned types.

newclarityex and others added 11 commits February 23, 2025 15:31
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Co-authored-by: Christian Hughes <9044780+ItsDoot@users.noreply.github.com>
Copy link
Contributor

@ItsDoot ItsDoot left a comment

Choose a reason for hiding this comment

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

LGTM!

@ItsDoot ItsDoot added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 7, 2025
@hymm
Copy link
Contributor

hymm commented Mar 7, 2025

NodeConfigs feels a little too generic. Would it make sense to call it ScheduleConfigs?

@newclarityex
Copy link
Contributor Author

NodeConfigs feels a little too generic. Would it make sense to call it ScheduleConfigs?

Yup, updated NodeConfigs and NodeConfig to ScheduleConfigs, although kept NodeType as is.

}
}

/// Stores data to differentiate different Node types
Copy link
Member

Choose a reason for hiding this comment

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

Needs doc links to Node.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

I really like the net effect here, but IMO the NodeType name is quite confusing, and not a good fit for a trait. How would Schedulable work for you?

Some little doc nits too :)

@newclarityex
Copy link
Contributor Author

I really like the net effect here, but IMO the NodeType name is quite confusing, and not a good fit for a trait. How would Schedulable work for you?

Some little doc nits too :)

Renamed and updated some docs :>

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 10, 2025
@alice-i-cecile
Copy link
Member

Manually resolved merge conflicts. You might need a cargo fmt in there. Ping me to re-attempt the merge if needed.

auto-merge was automatically disabled March 10, 2025 22:09

Head branch was pushed to by a user without write access

@newclarityex
Copy link
Contributor Author

Manually resolved merge conflicts. You might need a cargo fmt in there. Ping me to re-attempt the merge if needed.

i think we can reattempt it now

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 12, 2025
@alice-i-cecile
Copy link
Member

Awesome, thanks :) I appreciate it: merge conflicts can be super annoying on a project this big.

Merged via the queue into bevyengine:main with commit ecccd57 Mar 12, 2025
31 checks passed
@mnmaita
Copy link
Member

mnmaita commented Mar 13, 2025

FYI the migration guide doesn't seem to be up to date based on some naming changes made later.

@newclarityex
Copy link
Contributor Author

FYI the migration guide doesn't seem to be up to date based on some naming changes made later.

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants