fix: Remove deprecation warnings for 'disabled'. (#8104)

We must continue to support existing XML and JSON serialization formats since they are in external databases.

The decision was taken not to make the save formats compatible with older versions of Blockly.  We could not think of a convincing use-case for a newer Blockly's output to be read by an older Blockly.  If such a case appears, then our decision should change.

Resolves #8095.
This commit is contained in:
Neil Fraser
2024-05-14 17:55:43 +02:00
committed by GitHub
parent eb01ebe827
commit fca94ce799
2 changed files with 4 additions and 14 deletions

View File

@@ -10,7 +10,6 @@ import type {Block} from '../block.js';
import type {BlockSvg} from '../block_svg.js';
import type {Connection} from '../connection.js';
import {MANUALLY_DISABLED} from '../constants.js';
import * as deprecation from '../utils/deprecation.js';
import * as eventUtils from '../events/utils.js';
import {inputTypes} from '../inputs/input_types.js';
import {isSerializable} from '../interfaces/i_serializable.js';
@@ -523,12 +522,8 @@ function loadAttributes(block: Block, state: State) {
block.setEditable(false);
}
if (state['enabled'] === false) {
deprecation.warn(
'enabled',
'v11',
'v12',
'disabledReasons with the value ["' + MANUALLY_DISABLED + '"]',
);
// Before May 2024 we just used 'enabled', with no reasons.
// Contiune to support this syntax.
block.setDisabledReason(true, MANUALLY_DISABLED);
}
if (Array.isArray(state['disabledReasons'])) {

View File

@@ -10,7 +10,6 @@ import type {Block} from './block.js';
import type {BlockSvg} from './block_svg.js';
import type {Connection} from './connection.js';
import {MANUALLY_DISABLED} from './constants.js';
import * as deprecation from './utils/deprecation.js';
import * as eventUtils from './events/utils.js';
import type {Field} from './field.js';
import {IconType} from './icons/icon_types.js';
@@ -1023,12 +1022,8 @@ function domToBlockHeadless(
}
const disabled = xmlBlock.getAttribute('disabled');
if (disabled) {
deprecation.warn(
'disabled',
'v11',
'v12',
'disabled-reasons with the value "' + MANUALLY_DISABLED + '"',
);
// Before May 2024 we just used 'disabled', with no reasons.
// Contiune to support this syntax.
block.setDisabledReason(
disabled === 'true' || disabled === 'disabled',
MANUALLY_DISABLED,