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

Migrate core/blocks.js to goog.module syntax #5069

Merged
merged 2 commits into from
Jul 16, 2021

Conversation

moniika
Copy link
Contributor

@moniika moniika commented Jul 15, 2021

The basics

  • I branched from goog_module
  • My pull request is against goog_module
  • My code follows the style guide
  • My code is presented in the form suggested in the module
    conversion guide
  • I have run npm test locally already.

The details

Resolves

Part of #5026

Proposed Changes

Converts core/blocks.js to goog.module syntax.

@moniika moniika added this to the 2021_q3_release milestone Jul 15, 2021
@moniika moniika requested a review from a team as a code owner July 15, 2021 01:17
@moniika moniika requested a review from BeksOmega July 15, 2021 01:17
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.

LGTM! Just a suggested JSDoc fix while you're in the area.

core/blocks.js Outdated
@@ -14,10 +14,13 @@
* A mapping of block type names to block prototype objects.
* @name Blockly.Blocks
*/
goog.provide('Blockly.Blocks');
goog.module('Blockly.Blocks');
goog.module.declareLegacyNamespace();

/**
* A mapping of block type names to block prototype objects.
* @type {!Object<string,Object>}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you update the type annotation while you're here? I think it should be !Object<string, !Object>. Also I think this needs the dict annotation since outside devs add properties to it.

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've updated the type, but it seems like the @dict annotation isn't working when I try to build compressed.
I'm not going to add the @dict for now and I'll see about adding it in a future PR.

@moniika moniika force-pushed the convert-blocks branch 2 times, most recently from 36a5bac to 7381105 Compare July 16, 2021 01:19
@moniika moniika merged commit 99f8226 into google:goog_module Jul 16, 2021
@moniika moniika deleted the convert-blocks branch July 16, 2021 01:34
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.

3 participants