-
Notifications
You must be signed in to change notification settings - Fork 122
feat: support fetching dynamic assets and merging them to asset libra… #412
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements support for dynamic assets (sprites, backdrops, costumes, and sounds) that can be passed to the editor at runtime and merged with the bundled static assets. This enables in-app delivery of assets as part of the wider effort described in UEPR-467.
Key Changes:
- Added a new Redux reducer to manage dynamic assets state
- Implemented asset merging logic that combines static and dynamic assets, with dynamic assets taking precedence when names match
- Integrated dynamic assets into the sprite, costume, backdrop, and sound library containers
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/scratch-gui/src/reducers/gui.ts |
Integrated the new dynamic assets reducer into the root GUI reducer and initial state |
packages/scratch-gui/src/reducers/dynamic-assets.js |
Created new reducer to handle dynamic assets state with action creator for setting assets |
packages/scratch-gui/src/lib/merge-dynamic-assets.js |
Implemented utility function to merge static and dynamic asset arrays using name-based deduplication |
packages/scratch-gui/src/lib/assets-prop-types.js |
Defined PropTypes shapes for costume, sound, and sprite assets for type validation |
packages/scratch-gui/src/containers/sprite-library.jsx |
Connected to Redux store and integrated dynamic sprite merging into the sprite library |
packages/scratch-gui/src/containers/sound-library.jsx |
Connected to Redux store and integrated dynamic sound merging into the sound library |
packages/scratch-gui/src/containers/gui.jsx |
Added props for dynamic assets and dispatches updates to the store on mount and prop changes |
packages/scratch-gui/src/containers/costume-library.jsx |
Connected to Redux store and integrated dynamic costume merging into the costume library |
packages/scratch-gui/src/containers/backdrop-library.jsx |
Connected to Redux store and integrated dynamic backdrop merging into the backdrop library |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adzhindzhi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…ries
Resolves
https://scratchfoundation.atlassian.net/browse/UEPR-467
Proposed Changes
Support using dynamic assets optionally passed down to the editor.
Reason for Changes
Part of the wider effort of supporting in-app delivery of assets.