mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
chore: remove deprecated functionality for v10 (#7077)
* chore: remove deprecated functionality in events files * chore: remove deprecated items in renderers * chore: remove deprecated items in core * chore: remove mixin deprecation * chore: fix tests after removing deprecations
This commit is contained in:
@@ -9,7 +9,6 @@ goog.declareModuleId('Blockly.blockRendering');
|
||||
|
||||
import * as registry from '../../registry.js';
|
||||
import type {Theme} from '../../theme.js';
|
||||
import * as deprecation from '../../utils/deprecation.js';
|
||||
import {Measurable} from '../measurables/base.js';
|
||||
import {BottomRow} from '../measurables/bottom_row.js';
|
||||
import {Connection} from '../measurables/connection.js';
|
||||
@@ -34,7 +33,6 @@ import {TopRow} from '../measurables/top_row.js';
|
||||
import {Types} from '../measurables/types.js';
|
||||
|
||||
import {ConstantProvider} from './constants.js';
|
||||
import * as debug from './debug.js';
|
||||
import {Debug} from './debugger.js';
|
||||
import {Drawer} from './drawer.js';
|
||||
import type {IPathObject} from './i_path_object.js';
|
||||
@@ -63,23 +61,6 @@ export function unregister(name: string) {
|
||||
registry.unregister(registry.Type.RENDERER, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off the blocks debugger.
|
||||
*
|
||||
* @deprecated Use the debug renderer in **\@blockly/dev-tools** (See {@link
|
||||
* https://www.npmjs.com/package/@blockly/dev-tools}.)
|
||||
* @internal
|
||||
*/
|
||||
export function stopDebugger() {
|
||||
deprecation.warn(
|
||||
'Blockly.blockRendering.stopDebugger()',
|
||||
'September 2021',
|
||||
'September 2022',
|
||||
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)'
|
||||
);
|
||||
debug.stopDebugger();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize anything needed for rendering (constants, etc).
|
||||
*
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2021 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import * as goog from '../../../closure/goog/goog.js';
|
||||
goog.declareModuleId('Blockly.blockRendering.debug');
|
||||
|
||||
import * as deprecation from '../../utils/deprecation.js';
|
||||
|
||||
/** Whether or not the debugger is turned on. */
|
||||
let useDebugger = false;
|
||||
/**
|
||||
* Returns whether the debugger is turned on.
|
||||
*
|
||||
* @returns Whether the debugger is turned on.
|
||||
* @internal
|
||||
*/
|
||||
export function isDebuggerEnabled(): boolean {
|
||||
return useDebugger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on the blocks debugger.
|
||||
*
|
||||
* @deprecated March 2022. Use the rendering debugger in @blockly/dev-tools.
|
||||
* See https://www.npmjs.com/package/@blockly/dev-tools for more information.
|
||||
* @internal
|
||||
*/
|
||||
export function startDebugger() {
|
||||
deprecation.warn(
|
||||
'Blockly.blockRendering.debug.startDebugger()',
|
||||
'version 8',
|
||||
'version 10',
|
||||
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)'
|
||||
);
|
||||
useDebugger = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off the blocks debugger.
|
||||
*
|
||||
* @deprecated March 2022. Use the rendering debugger in @blockly/dev-tools.
|
||||
* See https://www.npmjs.com/package/@blockly/dev-tools for more information.
|
||||
* @internal
|
||||
*/
|
||||
export function stopDebugger() {
|
||||
deprecation.warn(
|
||||
'Blockly.blockRendering.debug.stopDebugger()',
|
||||
'version 8',
|
||||
'version 10',
|
||||
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)'
|
||||
);
|
||||
useDebugger = false;
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import {Types} from '../measurables/types.js';
|
||||
|
||||
import {isDynamicShape} from './constants.js';
|
||||
import type {ConstantProvider, Notch, PuzzleTab} from './constants.js';
|
||||
import * as debug from './debug.js';
|
||||
import type {RenderInfo} from './info.js';
|
||||
|
||||
/**
|
||||
@@ -67,9 +66,6 @@ export class Drawer {
|
||||
if (this.info_.RTL) {
|
||||
this.block_.pathObject.flipRTL();
|
||||
}
|
||||
if (debug.isDebuggerEnabled()) {
|
||||
this.block_.renderingDebugger?.drawDebug(this.block_, this.info_);
|
||||
}
|
||||
this.recordSizeOnBlock_();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ import type {BlockStyle, Theme} from '../../theme.js';
|
||||
import type {WorkspaceSvg} from '../../workspace_svg.js';
|
||||
|
||||
import {ConstantProvider} from './constants.js';
|
||||
import * as debug from './debug.js';
|
||||
import {Debug} from './debugger.js';
|
||||
import {Drawer} from './drawer.js';
|
||||
import type {IPathObject} from './i_path_object.js';
|
||||
import {RenderInfo} from './info.js';
|
||||
@@ -157,17 +155,6 @@ export class Renderer implements IRegistrable {
|
||||
return new Drawer(block, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance of the renderer's debugger.
|
||||
*
|
||||
* @returns The renderer debugger.
|
||||
* @suppress {strictModuleDepCheck} Debug renderer only included in
|
||||
* playground.
|
||||
*/
|
||||
protected makeDebugger_(): Debug {
|
||||
return new Debug(this.getConstants());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance of the renderer's marker drawer.
|
||||
*
|
||||
@@ -278,9 +265,6 @@ export class Renderer implements IRegistrable {
|
||||
* @internal
|
||||
*/
|
||||
render(block: BlockSvg) {
|
||||
if (debug.isDebuggerEnabled() && !block.renderingDebugger) {
|
||||
block.renderingDebugger = this.makeDebugger_();
|
||||
}
|
||||
const info = this.makeRenderInfo_(block);
|
||||
info.measure();
|
||||
this.makeDrawer_(block, info).draw();
|
||||
|
||||
Reference in New Issue
Block a user