If the compiler's type analysis becomes smarter, being able to show that
its output matches what is expected will become more important. Snapshot
testing is how we will solve that.
This is a breaking change.
Replaces logic that was previously in our scratch-gui fork.
Upstream does the opposite; they disable cloud variables when video
sensing is used. We can't do the same because of custom extensions.
Disabling all custom extensions when video sensing is used would be too
limiting. The concern with custom extensions is not that they will steal
private skins, but that a project could use their blocks to fetch()
color information to a remote server similar to cloud variables.
The end result is not dissimilar: Cloud variables and video sensing
shouldn't be used together.
The parameters didn't work in the way that you would expect. Only the
values provided in the first call to addAddonBlock would do anything,
and this gives a false impression that this will color the blocks in the
editor. Color options may be re-added in the future as part of a more
significant API update.
This adds a new mode of custom extension that runs outside of any
sandbox -- they're just <script> tags. This is disabled by default and
needs explicit opt-in. Documentation will be written later.
This also will save the URLs of the loaded custom extensions to
project.json when serializing a project. When deserializing a project,
this list can be read to automatically load the extensions. This, again,
is disabled by default and requires explicit opt-in.
A new mechanism called the SecurityManager was added to the extension
manager to facilitate these new features. This replaces workerMode and
is a breaking change.
Various other custom extension related changes were also added:
- Reject invalid URLs in loadExtensionURL
- Various cleanup and refactoring
Extends .sb2 importer to convert extension blocks from ScratchX project files
(.sbx) to the format we require.
This doesn't automatically load extensions; they still must be loaded manually.
We don't want people to make a project in TW with 20 cloud variables and then have issues importing it to Scratch.
The packager, which has no limit, will convert any variable that starts with ☁ to a cloud variable, so this can be worked around.