refactor: Make `InsertionMarkerPreviewer`'s block serialization amenable to subclassing. by gonfunko · Pull Request #9282 · RaspberryPiFoundation/blockly
The basics
The details
Resolves
Fixes part of gonfunko/scratch-blocks#193
Proposed Changes
This PR refactors InsertionMarkerPreviewer to make the serialization of a block to JSON for use as an insertion marker overridable in a subclass. Previously, this was done in a private method which also did various other setup tasks. This meant that subclasses could not practically change the configuration options passed to serialization.blocks.save(), whereas they can now override the new serializeBlockToInsertionMarker() method to do so.