io-actions/lifecycle.md
2025-02-07 11:53:41 -05:00

990 B

Lifecycle of a Blockly App

Using Blockly Tool

  • generate new app
  • configure
  • run the dev server
  • create a workspace, a toolbox, and some blocks
  • run the exporter
  • take your exported blockly files to where you want them

Blockly (De)Serialization

When Blockly.serialization.workspaces.load is called, serializers are called in order with state to deserialize.

Deserialization Order

  1. Variables
  2. Procedures
  3. Blocks Top-level blocks are deserialized in an arbitrary order.
  4. Type - constructs the block, calls its init method, mixes in extensions
  5. Attributes - including global block properties, like: x, y, collapsed, disabled, and data
  6. Extra state - see the Extensions and Mutators
  7. Parent Connection
  8. Icons - arbitrary order
  9. Fields - arbitrary order
  10. Input Blocks - both value and statement inputs, arbitrary order - recursive
  11. Next Blocks - recursive