-
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: add serialization of child blocks #5120
feat: add serialization of child blocks #5120
Conversation
core/serialization/blocks.js
Outdated
{ | ||
addCoordinates = false, | ||
addInputBlocks = true, | ||
addNextBlocks = false |
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.
It may be better to set this to true by default. Not sure.
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.
Hmm, what was the original reasoning for defaulting to false here?
My original assumption was that addNextBlocks
would be true, but I am not sure I have a great reason for it.
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.
Originally it was because I thought there were a lot of internal things in Blockly that used this behavior. But it turns out it's just copy paste, and everything else wants next blocks. I'll switch it over to true by default.
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.
Overall lgtm, I just have some questions about types.
core/serialization/blocks.js
Outdated
{ | ||
addCoordinates = false, | ||
addInputBlocks = true, | ||
addNextBlocks = false |
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.
Hmm, what was the original reasoning for defaulting to false here?
My original assumption was that addNextBlocks
would be true, but I am not sure I have a great reason for it.
607d0e8
to
703decb
Compare
* Add tests for serializing connected blocks * Add serialization of child blocks * Add tests for not serializing children * Add options for not serializing children * Fix types * Change addNextBlocks to default to true * Cleanup * Fix types
* Add tests for serializing connected blocks * Add serialization of child blocks * Add tests for not serializing children * Add options for not serializing children * Fix types * Change addNextBlocks to default to true * Cleanup * Fix types
* Add tests for serializing connected blocks * Add serialization of child blocks * Add tests for not serializing children * Add options for not serializing children * Fix types * Change addNextBlocks to default to true * Cleanup * Fix types
* Add tests for serializing connected blocks * Add serialization of child blocks * Add tests for not serializing children * Add options for not serializing children * Fix types * Change addNextBlocks to default to true * Cleanup * Fix types
The basics
Link for Diff: BeksOmega/blockly@cereal/field-upgrades...BeksOmega:cereal/connnected-blocks
The details
Resolves
Work on project cereal
Dependent on #5077
Proposed Changes
Adds support for serializing children of a block.
Does not handle deserialization.
Reason for Changes
Saving state is good.
Test Coverage
Added tests for:
save
ie do save or don't save.