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: Make generator types and BlockDefinition less restrictive #6185

Merged
merged 1 commit into from
Jun 3, 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

#6079 and problems introduced in #6174

Proposed Changes

Types all of the generators as any instead of Blockly.Generator. They used to be effectively any before (because they were broken), and typing them as Generator is incomplete because there are additional properties on each generator that aren't captured. So giving them a partial type is worse than any because there are additional type errors that would have to be silenced.

Same for the BlockDefinition which is used for Blockly.Blocks - it was typed as Object but even that is too strict as e.g. Objects don't have a property called jsonInit which we allow objects in Blockly.Blocks to have.

For more information, see the discussion in #6174

Behavior Before Change

Behavior After Change

Reason for Changes

Test Coverage

Tested in similar ways to #6174

Documentation

Additional Information

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.

None yet

2 participants