Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔨 Preemptively remove/overwrite extant components and systems when adding them to their type collections from @component and @system decorators #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rubybrowncoat
Copy link

@rubybrowncoat rubybrowncoat commented Aug 27, 2024

I'm opening this so we may discuss the approach to see if fits and holds up,

The repro repository for the hot-reloading issue is still at https://github.com/rubybrowncoat/becsy-hot-reloading but I pointed the @lastolivegames/becsy package to a local clone of the fork at https://github.com/rubybrowncoat/becsy that has been built with the changes.


This change is Reviewable

…ding them to their type collections from @component and @System decorators
@pkaminski
Copy link
Collaborator

If I'm reading the changes correctly, this makes the decorators deduplicate component and system types by name. This is dangerous: if you accidentally have two different types with the same name (an easy mistake to make in a large project!), Becsy will silently drop one of them.

I believe the right way to handle the issue is to get a notification when a module is being unloaded and pull all the types it defines out of the arrays at that time.

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.

2 participants