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: update extraState property in serializer typedefs #6057

Merged
merged 3 commits into from
Apr 1, 2022

Conversation

maribethb
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

In the JSON serializer there are two typedefs with a property called extra-state. This breaks the hell out of the typescript definitions because the compiler can't parse the jsdoc. e.g. the early commits here #6051 (and also last quarter had to be hand-fixed)

Proposed Changes

Adds quotations around the property. Properties with dashes can only be accessed with bracket notation and quotes, so adding the quotes helps the TypeScript parser.

I think this property probably should have been called extraState from the beginning. Is it worth changing now? It's probably somewhat annoying for an external developer because they have to use bracket notation. If we were to change it then asap would be better. We could probably handle both values in the serializer to avoid making that a breaking change? Not sure if it's worth it, would like your input Beka.

Behavior Before Change

Behavior After Change

Reason for Changes

Test Coverage

Tested this fixes the TypeScript definition generation problems; the output is no longer malformed with this change.

Documentation

Additional Information

@maribethb maribethb requested a review from BeksOmega March 31, 2022 21:33
@maribethb maribethb requested a review from a team as a code owner March 31, 2022 21:33
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.

I checked and that property is actually incorrect haha. It should be extraState, because that is what is actually being used by the serializer. Thanks for the catch!

core/serialization/blocks.js Outdated Show resolved Hide resolved
core/utils/toolbox.js Outdated Show resolved Hide resolved
maribethb and others added 2 commits March 31, 2022 16:32
Co-authored-by: Beka Westberg <bwestberg@google.com>
Co-authored-by: Beka Westberg <bwestberg@google.com>
@maribethb maribethb changed the title fix: add quotes to serializer typedefs fix: update extraState property in serializer typedefs Mar 31, 2022
@maribethb maribethb merged commit 55cae6e into google:develop Apr 1, 2022
@maribethb maribethb deleted the extra-state branch April 1, 2022 18:35
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.

2 participants