-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: prevent console logging duplicate deprecation warnings #7733
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome! It looks like this is your first pull request in Blockly, so here are a couple of tips:
- You can find tips about contributing to Blockly and how to validate your changes on our developer site.
- All contributors must sign the Google Contributor License Agreement (CLA). If the google-cla bot leaves a comment on this PR, make sure you follow the instructions.
- We use conventional commits to make versioning the package easier. Make sure your commit message is in the proper format or learn how to fix it.
- If any of the other checks on this PR fail, you can click on them to learn why. It might be that your change caused a test failure, or that you need to double-check the style guide.
Thank you for opening this PR! A member of the Blockly team will review it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi ebrahim95, and thanks for this contribution!
Overall it looks great but there is one small thing that needs to be fixed to comply with our style guide, and one other suggestion I have to make the code easier to read.
(I've also taken the liberty of tweaking some of your comments and the PR title to better fit with our usual style.)
Edited By Cpcallen Co-authored-by: Christopher Allen <[email protected]>
Edited By Cpcallen Co-authored-by: Christopher Allen <[email protected]>
@cpcallen I appreciate the suggestions 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you didn't update the other places that checkMsg
is used, and now there are syntax errors.
The basics
The details
Resolves
Fixes #7719
Proposed Changes
I added the Set Data structure to the deprecation.ts file to prevent logging multiple deprecation warnings.
Reason for Changes
The changes need to be made because if there are multiple warnings that have the same message,
then the warnings will be logged more than once in the console.
Test Coverage
I tested this by adding:
Blockly.utils.deprecation.warn('test warning', 'vA', 'vB', 'test substitute'); Blockly.utils.deprecation.warn('test warning', 'vA', 'vB', 'test substitute');
to the playground.html file.
If the warning appears once then the test was successful.
Documentation
Additional Information