Skip to content

Conversation

@gonfunko
Copy link
Owner

Resolves

This PR builds towards resolving #84. Built-in Blockly block comments do not have IDs, because they're just represented as part of the block. Scratch's old implementation did have IDs, which get serialized and are tracked by the VM to maintain its internal state in response to block comment events.

This change makes block comment IDs the same as their parent block's ID with _comment suffix. In partnership with a forthcoming PR in -vm, this will allow for consistent comment IDs between -blocks and -vm, which in turn fixes the interop issues described in #84.

Additionally, this PR fixes a bug that could cause the workspace and VM state to get out of sync due to events fired during block deserialization being suppressed.

@gonfunko gonfunko merged commit e824dcc into modern-blockly Feb 24, 2025
1 check passed
@gonfunko gonfunko deleted the stable-comment-ids branch February 24, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants