fix!: Remove event dependencies on XML #9536
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Fixes #9253
Proposed Changes
This PR removes dependencies on XML from the events system. This allows for headless use of Blockly in environments without DOM support, e.g. server-side NodeJS. The original issue only identified
BlockCreateas being problematic, butBlockDelete,CommentCreateandCommentDeletehave the same issue and have also been addressed.Breaking Change Details
This change is breaking for systems that depend on monitoring the XML-related fields in these events. Generally, the best migration path is to update code to use the equivalent JSON-serialized form stored in the events instead. Alternatively, you can subclass these events, add the XML-related fields in your subclass, and register your event subclasses with the Blockly registry, overriding the default implementations.