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: json hooks for lists blocks not needing extra state #6177

Merged

Conversation

gregdyke
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

#6176

Proposed Changes

Don't serialize xml mutations to extra state in json serialization for

  • lists_setIndex
  • lists_getSubList
  • lists_split

Behavior Before Change

xml mutations were serialized in json extra state and deserialized

Behavior After Change

xml mutations no longer serialized and are ignored on deserialization

Reason for Changes

  • not needed in JSON serialization
  • better (de-)serialization performance

Test Coverage

Added basic roundtrip (de)serialization tests, including with previous extra state

Documentation

Additional Information

@gregdyke gregdyke requested a review from a team as a code owner May 27, 2022 18:49
@gregdyke gregdyke requested a review from cpcallen May 27, 2022 18:49
@BeksOmega BeksOmega requested review from BeksOmega and removed request for cpcallen June 2, 2022 20:53
@BeksOmega BeksOmega assigned BeksOmega and unassigned cpcallen Jun 2, 2022
Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, this looks great :D Thank you for the fix! I hate having ugly XML in the JSON. Tests look beautiful =)

@BeksOmega BeksOmega merged commit 8b69b61 into google:develop Jun 3, 2022
title:
'JSON with XML extra state',
json: {
...serializedJson,
Copy link
Contributor

Choose a reason for hiding this comment

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

I was confused about why a build of a clean checkout of develop was resulting in changes to tests/deps.mocha.js. It turns out that this use of ... meant that lists_test.js went from being ES6 to ES2018, and closure-make-deps tries to update testsd/deps.mocha.js accordingly, but that that update was not included in the same commit.

Not worth fixing now, since PR #6205 is about to delete the deps files from the repo, but a useful reminder to us all to keep an eye out for changes to generated files and try make sure they get checked in at the same time as the change which caused them least we confuse our colleagues…

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.

3 participants