Skip to content

Commit

Permalink
deprecate: the debug renderer (google#5961)
Browse files Browse the repository at this point in the history
* deprecate: the debug renderer

* chore: run format

* chore: remove @deprecated for functions still used in core
  • Loading branch information
alschmiedt authored Mar 1, 2022
1 parent fa14e9d commit 9ba2571
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/renderers/common/block_rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ const {Types} = goog.require('Blockly.blockRendering.Types');
* @return {boolean} Whether the debugger is turned on.
* @alias Blockly.blockRendering.isDebuggerEnabled
* @package
* @deprecated
*/
const isDebuggerEnabled = function() {
deprecation.warn(
'Blockly.blockRendering.isDebuggerEnabled()', 'September 2021',
'September 2022', 'Blockly.blockRendering.debug.isDebuggerEnabled()');
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
return debug.isDebuggerEnabled();
};
exports.isDebuggerEnabled = isDebuggerEnabled;
Expand Down Expand Up @@ -91,11 +93,13 @@ exports.unregister = unregister;
* Turn on the blocks debugger.
* @package
* @alias Blockly.blockRendering.startDebugger
* @deprecated
*/
const startDebugger = function() {
deprecation.warn(
'Blockly.blockRendering.startDebugger()', 'September 2021',
'September 2022', 'Blockly.blockRendering.debug.startDebugger()');
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
debug.startDebugger();
};
exports.startDebugger = startDebugger;
Expand All @@ -104,11 +108,13 @@ exports.startDebugger = startDebugger;
* Turn off the blocks debugger.
* @package
* @alias Blockly.blockRendering.stopDebugger
* @deprecated
*/
const stopDebugger = function() {
deprecation.warn(
'Blockly.blockRendering.stopDebugger()', 'September 2021',
'September 2022', 'Blockly.blockRendering.debug.stopDebugger()');
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
debug.stopDebugger();
};
exports.stopDebugger = stopDebugger;
Expand Down
15 changes: 15 additions & 0 deletions core/renderers/common/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
goog.module('Blockly.blockRendering.debug');

const deprecation = goog.require('Blockly.utils.deprecation');


/**
* Whether or not the debugger is turned on.
Expand All @@ -28,6 +30,11 @@ let useDebugger = false;
* @package
*/
const isDebuggerEnabled = function() {
deprecation.warn(
'Blockly.blockRendering.debug.isDebuggerEnabled()', 'February 2022',
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');

return useDebugger;
};
exports.isDebuggerEnabled = isDebuggerEnabled;
Expand All @@ -38,6 +45,10 @@ exports.isDebuggerEnabled = isDebuggerEnabled;
* @alias Blockly.blockRendering.debug.startDebugger
*/
const startDebugger = function() {
deprecation.warn(
'Blockly.blockRendering.debug.startDebugger()', 'February 2022',
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
useDebugger = true;
};
exports.startDebugger = startDebugger;
Expand All @@ -48,6 +59,10 @@ exports.startDebugger = startDebugger;
* @alias Blockly.blockRendering.debug.stopDebugger
*/
const stopDebugger = function() {
deprecation.warn(
'Blockly.blockRendering.debug.stopDebugger()', 'February 2022',
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
useDebugger = false;
};
exports.stopDebugger = stopDebugger;

0 comments on commit 9ba2571

Please sign in to comment.