Skip to content

Conversation

@BeksOmega
Copy link
Contributor

@BeksOmega BeksOmega commented Jul 14, 2021

The basics

  • I branched from project-cereal
  • My pull request is against project-cereal
  • My code follows the style guide

Link for Diff: BeksOmega/blockly@cereal/block-serialization...BeksOmega:cereal/mutator-serialization

The details

Resolves

Work on project cereal.
Dependent on #5053

Proposed Changes

Adds serialization of mutators on blocks. Handles backwards compatibility with the XML hooks by converting them to a string before appending them to the JSO. That was removed in favor of investigating upgrading developers' files directly using a script.

Does not handle deserialization.

Reason for Changes

Serializing state is good.

Test Coverage

Added tests for the different categories of objects the save function could return. Also added a test for wrapping the mutationToDom hook.

@BeksOmega BeksOmega force-pushed the cereal/mutator-serialization branch from f3633ff to 21ff2a8 Compare July 14, 2021 21:48
@BeksOmega BeksOmega mentioned this pull request Jul 15, 2021
3 tasks
@BeksOmega BeksOmega force-pushed the cereal/mutator-serialization branch from ae80a35 to 9980a25 Compare July 23, 2021 22:11
@BeksOmega BeksOmega marked this pull request as ready for review July 23, 2021 22:21
@BeksOmega BeksOmega requested a review from a team as a code owner July 23, 2021 22:21
@BeksOmega
Copy link
Contributor Author

@NeilFraser do you want to grab this one?

@BeksOmega BeksOmega assigned NeilFraser and unassigned maribethb and alschmiedt Jul 29, 2021
* Adds any extra state the block may provide to the given state object.
* @param {!Blockly.Block} block The block to serialize the extra state of.
* @param {!State} state The state object to append
* to.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment can be one line. Same for line 74 whence this was copied.

@BeksOmega BeksOmega merged commit 8f1f670 into RaspberryPiFoundation:project-cereal Jul 30, 2021
BeksOmega added a commit to BeksOmega/blockly that referenced this pull request Sep 13, 2021
* Add tests for saving extra state

* Add serializing extra state

* Fix backwards compatibility

* Switch to other function declarations

* Handle null returns from hooks

* Remove backwards compatibility

* Remove XML require, and fix type

* Fix JSDoc formatting
@BeksOmega BeksOmega deleted the cereal/mutator-serialization branch September 16, 2021 15:32
BeksOmega added a commit that referenced this pull request Sep 17, 2021
* Add tests for saving extra state

* Add serializing extra state

* Fix backwards compatibility

* Switch to other function declarations

* Handle null returns from hooks

* Remove backwards compatibility

* Remove XML require, and fix type

* Fix JSDoc formatting
alschmiedt pushed a commit to alschmiedt/blockly that referenced this pull request Sep 20, 2021
* Add tests for saving extra state

* Add serializing extra state

* Fix backwards compatibility

* Switch to other function declarations

* Handle null returns from hooks

* Remove backwards compatibility

* Remove XML require, and fix type

* Fix JSDoc formatting
alschmiedt pushed a commit that referenced this pull request Sep 20, 2021
* Add tests for saving extra state

* Add serializing extra state

* Fix backwards compatibility

* Switch to other function declarations

* Handle null returns from hooks

* Remove backwards compatibility

* Remove XML require, and fix type

* Fix JSDoc formatting
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.

4 participants