Skip to content

Investigate Progressive loading of the toolbox #1905

@picklesrus

Description

@picklesrus

To load scratch-blocks, we parse and render every single block in the toolbox immediately. In Scratch there are currently ~180 blocks in the toolbox (without extensions) which makes loading significantly slower.

Investigate whether we can load the visible blocks first (e.g. the first ~10-20) and defer loading the rest.

Ideas:

  • Change the default toolbox to only contain the first 10-20 blocks, then use the Blockly.Xml.appendDomToWorkspace to append the rest in an idleTimeout.

Other thoughts:
IIRC, the way flyout rendering currently works is that it reads all the blocks out of the xml, puts them in the SVG, then moves them to the appropriate place. It'd be great to untangle that so there isn't a separate move step, but I'd try the approach above first to side step that.

What's suggested above would only work on load, but theoretically could be applied to the workspace's updateToolbox method as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions