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!: remove deprecated functionality for v10 #7077

Merged
merged 5 commits into from
May 11, 2023

Conversation

rachel-fenichel
Copy link
Collaborator

@rachel-fenichel rachel-fenichel commented May 11, 2023

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

Fixes #6814
Remake of #6862

Proposed Changes

Remove deprecated methods/classes/files that were slated for removal in v10 or before June 2023. In v9, these functions printed deprecation warnings.

Additional Information

The following APIs have been removed, and where applicable the replacement is specified:

  • Blockly.resizeSvgContents() (use Blockly.WorkspaceSvg#resizeSvgContents)
  • Blockly.copy (use Blockly.clipboard.copy)
  • Blockly.paste (use Blockly.clipboard.paste)
  • Blockly.duplicate (use Blockly.clipboard.duplicate)
  • Blockly.isNumber (use Blockly.utils.string.isNumber)
  • Blockly.hueToHex (use Blockly.utils.colour.hueToHex)
  • Blockly.bindEvent_ (use Blockly.browserEvents.bind)
  • Blockly.unbindEvent_ (use Blockly.browserEvents.unbind)
  • Blockly.bindEventWithChecks_ (use Blockly.browserEvents.conditionalBind)
  • The opt_noPreventDefault argument of Blockly.browserEvents.bind (this was already unused and will continue to be)
  • Blockly.Events.Abstract#fromJson the same method in other Event classes (use Blockly.Events.fromJson)
  • The Blockly.Events.Ui class (use a more specific UI event that extends Blockly.Events.UiBase)
  • Blockly.CodeGenerator#variableDB_ (use Blockly.CodeGenerator#nameDB_ e.g. javascriptGenerator.nameDB_)
  • Blockly.alert, Blockly.prompt, and Blockly.confirm (use Blockly.dialog.alert/setAlert, Blockly.dialog.prompt/setPrompt, and Blockly.dialog.confirm/setConfirm)
  • Blockly.mainWorkspace (use Blockly.getMainWorkspace())
  • Blockly.selected (use Blockly.getSelected()/setSelected())
  • Blockly.HSV_SATURATION and Blockly.HSV_VALUE (use Blockly.colour.getHsvSaturation/setHsvSaturation and Blockly.colour.getHsvValue/setHsvValue)
  • Blockly.ContextMenu.currentBlock (use Blockly.ContextMenu.getCurrentBlock/setCurrentBlock)
  • Blockly.Events.recordUndo (use Blockly.Events.getRecordUndo/setRecordUndo)
  • Blockly.Tooltip.visible and Blockly.Tooltip.DIV (use Blockly.Tooltip.isVisible and Blockly.Tooltip.getDiv)
  • Blockly.WidgetDiv.DIV (use Blockly.WidgetDiv.getDiv)
  • Many utilities in Blockly.Touch (use PointerEvents instead of touch-specific events)
  • Many utilities in Blockly.utils (use the new location e.g. Blockly.utils.svgMath depending on the function)
  • Blockly.utils.object.assign and Blockly.utils.object.inherits (use Object.assign and ES6 class inheritance)
  • Blockly.utils.object.values (use Object.values)
  • Blockly.utils.style.getCascadedStyle (leave Blockly out of your css shenanigans)
  • Blockly.utils.svgMath.is3dSupported (we now always assume 3d transforms are supported, so you can too)
  • Blockly.utils.xml.getDocument/setDocument/textToDomDocument (no longer provided)
  • Blockly.Xml.textToDom (use Blockly.utils.xml.textToDom)
  • You must now pass a block to the Blockly.icons.Icon and Blockly.icons.MutatorIcons constructors
  • The debug renderer has been removed entirely (use the one in @blockly/dev-tools)

@rachel-fenichel rachel-fenichel added type: cleanup breaking change Used to mark a PR or issue that changes our public APIs. labels May 11, 2023
@rachel-fenichel rachel-fenichel requested a review from a team as a code owner May 11, 2023 21:21
@rachel-fenichel rachel-fenichel requested a review from maribethb May 11, 2023 21:21
@github-actions github-actions bot removed the breaking change Used to mark a PR or issue that changes our public APIs. label May 11, 2023
@github-actions github-actions bot added the PR: chore General chores (dependencies, typos, etc) label May 11, 2023
@BeksOmega BeksOmega self-requested a review May 11, 2023 21:22
@rachel-fenichel rachel-fenichel merged commit de904ab into google:develop May 11, 2023
@rachel-fenichel rachel-fenichel deleted the v10_deprecation branch May 11, 2023 21:30
@github-actions github-actions bot added PR: chore General chores (dependencies, typos, etc) and removed PR: chore General chores (dependencies, typos, etc) labels Jun 26, 2023
@maribethb maribethb changed the title chore: remove deprecated functionality for v10 refactor!: remove deprecated functionality for v10 Jun 26, 2023
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: refactor and removed PR: chore General chores (dependencies, typos, etc) labels Jun 26, 2023
Comment on lines -180 to -210
/**
* The richness of block colours, regardless of the hue.
* Must be in the range of 0 (inclusive) to 1 (exclusive).
* @name Blockly.HSV_SATURATION
* @type {number}
* @suppress {checkTypes}
*/
HSV_SATURATION: {
get: function () {
return colour.getHsvSaturation();
},
set: function (newValue) {
colour.setHsvSaturation(newValue);
},
},
/**
* The intensity of block colours, regardless of the hue.
* Must be in the range of 0 (inclusive) to 1 (exclusive).
* @name Blockly.HSV_VALUE
* @type {number}
* @suppress {checkTypes}
*/
HSV_VALUE: {
get: function () {
return colour.getHsvValue();
},
set: function (newValue) {
colour.setHsvValue(newValue);
},
},
});
Copy link
Contributor

Choose a reason for hiding this comment

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

These were removed despite not being deprecated, and this has provoked at least one question in the forum.

@maribethb and @rachel-fenichel: I think we should restore these (with a @deprecation and deprecation.warn() and issue a patch release promptly, and re-remove them in a future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Used to mark a PR or issue that changes our public APIs. PR: refactor type: cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warning removal for v10
4 participants