-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: Insertion marker json deserialization 7316 #7364
feat: Insertion marker json deserialization 7316 #7364
Conversation
The error - Did you forget to signal async completion? is because am I missing fields with the modified serialization/de-serialization, or maybe I have to review the dependencies. Furthermore, I have not yet conducted any testing on this, as I am seeking confirmation whether these are the potential modifications that we intended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Just one style change and then should be good to go =)
I also wanted to know if we need to make any changes to the documents? |
Nope I think this change should be good! |
Don't add next block to the insertion marker when we do an insertion marker json serialization. Also, to keep consistent with the old behavior, we don't need to add input blocks for the insertion marker. And we don't need to do a full serialization here as it will just become an insertion marker. Resolves #7383 Address issues in PR #7364 Signed-off-by: Hollow Man <[email protected]>
Don't add next block to the insertion marker when we do an insertion marker json serialization. Also, to keep consistent with the old behavior, we don't need to add input blocks for the insertion marker. And we don't need to do a full serialization here as it will just become an insertion marker. Resolves #7383 Address issues in PR #7364 Signed-off-by: Hollow Man <[email protected]> (cherry picked from commit 18ee0ec)
This reverts commit 8421538.
The basics
npm run format
andnpm run lint
The details
Resolves
Proposed Changes
Change the insertion marker
createMarkerBlock
code over to use JSON serialization and deserialization.Behavior Before Change
In Blockly's XML serialization, child blocks are represented using nested XML elements. This means that if a block has child blocks connected to it, those child blocks will be represented as nested XML elements within the XML element representing the parent block. The structure of the XML serialization mirrors the structure of the blocks in the workspace.
Behavior After Change
The JSON serialization system in Blockly does something similar, but with a JSON structure instead of XML. The structure of the serialized data, whether XML or JSON, is designed to capture the hierarchical relationships between blocks and their connections.
Reason for Changes
Insertion markers duplicate the block being dragged, and then tell the duplicate to be an insertion marker.
Currently the duplication duplicates (ha) a lot of code from the serialization system. We think this is because in the past the XML system didn't have a good way to just serialize and deserialize a single block (without children). But the JSON system does have this!
Test Coverage
Documentation
Additional Information