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(codelabs): Update custom generator codelab to use CodeGenerator #2489

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

mmvarma-pro
Copy link
Contributor

The custom generator codelab was using the deprecated Blockly.Generator class. This updates it to use Blockly.CodeGenerator instead, which is the new recommended way to create custom generators.

Mentioned in #6584

The basics

The details

Resolves

Fixes #6584

Proposed Changes

Updates the custom generator codelab to use Blockly.CodeGenerator instead of the deprecated Blockly.Generator class. This change ensures the codelab follows current best practices and uses the recommended API.

Reason for Changes

The Blockly.Generator class is deprecated and will be removed in a future version. This update ensures that developers following the codelab will learn to use the current recommended approach with Blockly.CodeGenerator.

Test Coverage

Manually tested by:

  1. Following the codelab steps with the updated code
  2. Verifying that the JSON generator works correctly with all block types
  3. Confirming that the generated JSON output matches the expected format
  4. Testing that the workspace saves and loads correctly

Documentation

No additional documentation changes needed. The codelab itself is being updated to reflect the current API.

Additional Information

This is part of the ongoing effort to update documentation and learning materials to use the latest Blockly APIs and remove references to deprecated functionality.

The custom generator codelab was using the deprecated Blockly.Generator class.
This updates it to use Blockly.CodeGenerator instead, which is the new
recommended way to create custom generators.

Mentioned in #6584
@mmvarma-pro mmvarma-pro requested a review from a team as a code owner February 15, 2025 00:35
@mmvarma-pro mmvarma-pro requested review from RoboErikG and removed request for a team February 15, 2025 00:35
Copy link

google-cla bot commented Feb 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mmvarma-pro mmvarma-pro marked this pull request as draft February 15, 2025 00:38
@mmvarma-pro mmvarma-pro marked this pull request as ready for review February 15, 2025 00:38
@mmvarma-pro
Copy link
Contributor Author

{A71FB9F0-7677-49E1-B4A3-54CB967DFB8C}

Signed the CLA

Copy link
Contributor

@RoboErikG RoboErikG left a comment

Choose a reason for hiding this comment

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

Thanks for contributing to Blockly, @mmvarma-pro !

@RoboErikG RoboErikG merged commit e181918 into google:master Feb 21, 2025
9 checks passed
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