8000 refactor: use IDs based on the parent block ID for block comments by gonfunko · Pull Request #227 · gonfunko/scratch-blocks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: use IDs based on the parent block ID for block comments #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2025

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.

2 participants
0