Skip to content

Commit

Permalink
fix: Remove deprecation warnings for 'disabled'. (#8104)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NeilFraser authored May 14, 2024
1 parent eb01ebe commit fca94ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions core/serialization/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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'])) {
Expand Down
9 changes: 2 additions & 7 deletions core/xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fca94ce

Please sign in to comment.