Skip to content
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

fix!: have insertion markers use json deserialization #7730

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

BeksOmega
Copy link
Collaborator

@BeksOmega BeksOmega commented Dec 19, 2023

The basics

The details

Resolves

Fixes #7316

Proposed Changes

Reverts #7430 #7429

Makes it so that insertion markers are created using JSON deserialization.

Reason for Changes

From #7364

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!

Sparked by this discussion: https://groups.google.com/g/blockly/c/gcvynl88QLY/m/shFyX4x0BwAJ

Test Coverage

All tests pass.

Documentation

Additional Information

N/A

Breaking changes / To fix

Insertion-marker-ness is now set after any mutation is deserialized.

If you have a block whose behavior depeonds on whether it is an insertion marker or not, they should check doFullSerialization instead. Insertion markers pass doFullSerialization as false. Ensure that if your block has a backing data model, insertion markers either properly create and destroy those models, or properly reference and do not destroy those models.

You can see the shareable procedure blocks for an example of round-tripping whether doFullSerialization was enabled from saveExtraState to loadExtraState.

@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug labels Dec 19, 2023
@BeksOmega BeksOmega marked this pull request as ready for review December 19, 2023 21:18
@BeksOmega BeksOmega requested a review from a team as a code owner December 19, 2023 21:18
@BeksOmega BeksOmega marked this pull request as draft December 19, 2023 21:18
@BeksOmega BeksOmega changed the base branch from develop to rc/v11.0.0 December 19, 2023 21:19
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Dec 19, 2023
@BeksOmega BeksOmega changed the base branch from rc/v11.0.0 to v11-breaks January 8, 2024 22:23
@BeksOmega BeksOmega marked this pull request as ready for review January 8, 2024 22:23
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Jan 8, 2024
Copy link
Contributor

@maribethb maribethb left a comment

Choose a reason for hiding this comment

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

LGTM, but please fix the description of the PR to include the directions for breaking changes directly instead of describing what would be in the release notes

@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Jan 10, 2024
@BeksOmega BeksOmega merged commit 2572db1 into google:v11-breaks Jan 10, 2024
13 checks passed
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Jan 29, 2024
@github-actions github-actions bot added the PR: fix Fixes a bug label Jan 29, 2024
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change insertion markers to use JSON deserialization when duplicating blocks
2 participants