Skip to content

Change App.registerSystem#317

Merged
waynemwashuma merged 2 commits into
wimaengine:devfrom
waynemwashuma:change-app-register-systems
May 15, 2026
Merged

Change App.registerSystem#317
waynemwashuma merged 2 commits into
wimaengine:devfrom
waynemwashuma:change-app-register-systems

Conversation

@waynemwashuma
Copy link
Copy Markdown
Collaborator

Objective

Refactor the system registration API to use a configuration object instead of positional arguments.

Solution

Changed App.registerSystem(schedule, system) to App.registerSystem({ schedule, system }).The previous signature limited flexibility (e.g. adding system groups, ordering metadata, labels, etc. in the future) and made the API less explicit.

This change makes the registration more readable and prepares the scheduling system for future enhancements.

Showcase

Before

app
  .registerSystem(AppSchedule.Startup, init)
  .registerSystem(AppSchedule.Update, setupViewport)
  .registerSystem(AppSchedule.Startup, addDefaultCamera2D)

After

app
  .registerSystem({ schedule: AppSchedule.Startup, system: init })
  .registerSystem({ schedule: AppSchedule.Update, system: setupViewport })
  .registerSystem({ schedule: AppSchedule.Startup, system: addDefaultCamera2D })

Migration Guide

This is a breaking change.

Replace all occurrences of:

.registerSystem(ScheduleLabel, systemFunction)

with:

.registerSystem({ schedule: ScheduleLabel, system: systemFunction })

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this May 15, 2026
@github-actions github-actions Bot added mod:app mod:command mod:input mod:math mod:render mod:event mod:window mod:physics mod:asset mod:transform mod:movable mod:device mod:audio mod:tween This PR/issue affects the `tween` package mod:reflect mod:hierarchy mod:gizmos Affects the gizmos package. mod:color This affects the color package mod:animation This PR/issue affects the animation system mod:time This PR/issue affect the time package mod:schedule This PR/issue affects the schedule module mod:diagnostic This issue/PR affects the diagnostic module mod:geometry This PR/issue affects geometry package mod:scene This affects the scene package mod:emitter This PR/issue affects emitter package labels May 15, 2026
@waynemwashuma waynemwashuma added rep:breaking type:change mod:app and removed mod:input mod:math mod:render mod:event mod:window mod:physics mod:asset mod:transform mod:movable mod:device mod:audio mod:tween This PR/issue affects the `tween` package mod:reflect mod:hierarchy mod:gizmos Affects the gizmos package. mod:color This affects the color package mod:animation This PR/issue affects the animation system mod:time This PR/issue affect the time package mod:schedule This PR/issue affects the schedule module mod:diagnostic This issue/PR affects the diagnostic module mod:geometry This PR/issue affects geometry package mod:scene This affects the scene package mod:emitter This PR/issue affects emitter package labels May 15, 2026
@waynemwashuma waynemwashuma merged commit c173be6 into wimaengine:dev May 15, 2026
7 checks passed
@waynemwashuma waynemwashuma deleted the change-app-register-systems branch May 15, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant