Logo Subsystem – Global State Reduction Refactor#5593
Logo Subsystem – Global State Reduction Refactor#5593walterbender merged 1 commit intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
2 similar comments
|
✅ All Jest tests passed! This PR is ready to merge. |
|
✅ All Jest tests passed! This PR is ready to merge. |
ea77cc9 to
a78e71e
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
f8afd16 to
5a1ebc0
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
5a1ebc0 to
290460f
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender Please have a review on this |
|
Maybe you need to rebase? This won't open for me. |
290460f to
9a56bb0
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
@walterbender Rebased |
|
Some other changes crept back in. mespeak was recently removed. |
9a56bb0 to
469f44e
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
I’ve rebased onto latest master and removed all mespeak references that had crept back in. |
Introduce LogoDependencies for explicit dependency injection in Logo. Remove meSpeak references following its removal from master. Aligned with latest master and applied Prettier formatting.
469f44e to
ca46d2e
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
I’ve rebased onto latest master and removed all mespeak references that had crept back in. |
Overview
This refactor improves the Logo subsystem by reducing its reliance on implicit global state through explicit dependency injection. The work is a scoped architectural improvement aligned with Identify and/or fix high-level inconsistencies (#2767).
The goal is to improve maintainability, testability, and clarity without changing existing behavior.
What This Refactor Does
LogoDependenciesabstraction to encapsulate external dependencies:window.widgetWindows)Singer,Tone.js,Notation,Synth,StatusMatrix)Logoconstructor to accept injected dependenciesLogoDependencies.fromGlobals(activity)Logowith explicit dependency accessWhy This Is Necessary (#2767)
Issue #2767 identifies systemic architectural inconsistencies caused by tight coupling, implicit globals, and monolithic design.
This change addresses one focused sub-problem—implicit global state in the Logo subsystem—without attempting a broad rewrite.
Verification
js/tests/logo.test.js) pass with no regressionsjs/tests/logo_dependencies.test.js) to verify initialization with mocked dependenciesScope and Impact