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

refactor(blocks): Migrate blocks/procedures.js to TypeScript #7192

Merged
merged 6 commits into from
Jun 21, 2023

Conversation

cpcallen
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

Part of #6828.

blocks/procedures.ts Outdated Show resolved Hide resolved
if (quarkId in this.quarkConnections_) {
const connection = this.quarkConnections_[quarkId];
// TODO(#6920): investigate claimed circular initialisers.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "circular intialisers" refer to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From #6920:

setProcedureParameters_ unexpectedly required declarations of the types of the quarkId and connection local variables avoid "implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer" errors. Since the definitions do not appear to be circular (though connection is initialised based on quarkId) this smells and probably warrants further investigation.

blocks/procedures.ts Show resolved Hide resolved
blocks/procedures.ts Outdated Show resolved Hide resolved
blocks/procedures.ts Outdated Show resolved Hide resolved
field.setValidator(this.validator_);
// Hack: override showEditor to do just a little bit more work.
// We don't have a good place to hook into the start of a text edit.
field.oldShowEditorFn_ = field.showEditor_;
field.oldShowEditorFn_ = (field as AnyDuringMigration).showEditor_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add a TODO comment pointing at #6920 for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could, but #6920 already mentions use of as, and I had been treating the "DuringMigration" part as making it implicitly clear that it was not OK.

I've added a note to #6920 to check for AnyDuringMigration in particular, though.

cpcallen added a commit to cpcallen/blockly that referenced this pull request Jun 21, 2023
(Replaces an earlier commit that inadvertently introduced a
syntax error.)
@cpcallen cpcallen merged commit ec71261 into google:develop Jun 21, 2023
@cpcallen cpcallen deleted the fix/6828/blocks/procedures branch June 21, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update BlockDefinition type import in block definition files
3 participants