Platform info in serialized SB3 files #205
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Adds a
platform
object to the SB3 save files.The object can contain arbitrary info about the platform (in this case TurboWarp) if the project is loaded in other Scratch-like editors.
Reason for Changes
The goal of this addition is to allow TurboWarp and other forks of it to use this information in the case that the user is loading an unsupported project from another platform. The purposes of each parameter is as follows:
platform.name
: Used as a user-friendly way of stating where the project came from.platform.url
: Can be used in the case the user needs a link to the original source of the project.platform.version
: Can be used in the case a TurboWarp project is loaded from an experimental site (ex: staging.turbowarp.org) into the main site. (although, may be removed in favor of meta.vm if breaking changes require vm updates)The hope is that other TurboWarp forks will update this information when they rebrand other parts of the editor.
It would also be hopefully possible to implement a warning message when the user is loading a project from an unknown platform, similar to Custom Unsandboxed Extensions. This would be useful to prevent invalid SB3 files from causing errors since the user will know the file is from another platform (and which exact one) and may contain unrecognized/invalid blocks or missing data.
Test Coverage
None seem to be required, but can be requested if necessary