Arch/modularize artwork asset registry#6534
Arch/modularize artwork asset registry#6534vanshika2720 wants to merge 1 commit intosugarlabs:masterfrom
Conversation
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
|
still working/testing |
e950dcc to
3c3585a
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
3c3585a to
b52259b
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: |
|
✅ All Jest tests passed! This PR is ready to merge. |
1 similar comment
|
✅ 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: |
|
✅ All Jest tests passed! This PR is ready to merge. |
8926273 to
efac971
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
efac971 to
f4edbdd
Compare
|
❌ Some Jest tests failed. Please check the logs and fix the issues before merging. Failed Tests: |
PR Description: Modularize artwork.js into a Managed AssetRegistry
Overview
This PR refactors the monolithic
js/artwork.jsfile to eliminate global namespace pollution and provide a modern, centralized API for visual asset management. By moving from ad-hoc regex replacements to a structuredAssetRegistry, we improve code maintainability and solve the long-standing "architectural bottleneck" associated with SVG handling in Music Blocks.Key Changes
AssetRegistry: A central repository injs/artwork.jsfor all SVG assets and visual constants.getSVG(iconName, options): A new, consistent API for retrieving and dynamically styling SVGs (supportingfillColor,strokeColor, and arbitraryplaceholders).turtles.js,activity.js,EnsembleBlocks.js,turtle-painter.js,trash.js,themebox.js, andpalette.jsto use the new API.globalvariable dependencies in multiple core files.js/__tests__/artwork.test.js.How to Test
npm test js/__tests__/artwork.test.jsto verify the new API.npm test js/blocks/__tests__/EnsembleBlocks.test.jsto ensure block rendering logic is preserved.Goal
Reduce the memory footprint of the global namespace and modernize visual asset management for Music Blocks v4.