-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Save and Load sb3 projects #1564
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
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.
Similar to my comments on scratchfoundation/scratch-vm#964, I think the jszip
dependency should be in scratch-storage
. Is that your plan in the long run?
The code looks good to me, other than that concern.
@cwillisf, I agree with removing the JSZip dependency from scratch-gui, as it's not strictly necessary. In regards to moving the JSZip dependency out of scratch-vm and into scratch-storage, I think that means that scratch-storage will have to keep the unpacked zip assets around until vm is done deserializing the project (and vm will subsequently make requests to scratch-storage to fetch the assets it needs). When the VM is done deserializing, it can tell storage to get rid of the zip. I think this way, we can make sure that storage is not doing unnecessary work of decoding extraneous files, and is also not storing large files forever. How does this sound? |
…s functionality gets moved to scratch-storage).
@cwillisf, I removed the JSZip dependency out of here. VM now unpacks the zip for the short term. I will eventually move this functionality into scratch-storage if my above comment sounds like a good plan. =] |
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.
Sounds good. Thanks!
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.
This looks great, thanks @kchadha!
Proposed Changes
Save button (when manually enabled) downloads a zip containing:
For sounds and costumes, this should include any edits made in the sound/costume editor respectively.
Load button (when manually enabled) should take in a zip that was previously downloaded via the save button, and the project should load and sounds and costumes should be up to date.
These changes depend on scratchfoundation/scratch-vm#964, and should not be merged until after that PR has been merged.
Reason for Changes
Towards a working SB3 Save and Load implementation.
Test Coverage
Existing tests pass, but integration tests for saving and loading need to be added in the near future.
Changes to come