From f39d2328e32dbd3701623faad57dd565cb2fd3eb Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Wed, 8 Jan 2025 10:52:18 -0800 Subject: [PATCH] chore: Add deprecation notices. --- core/procedures.ts | 7 +++++++ core/variables.ts | 7 +++++++ core/variables_dynamic.ts | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/core/procedures.ts b/core/procedures.ts index db6b68b712..73f06836cf 100644 --- a/core/procedures.ts +++ b/core/procedures.ts @@ -42,6 +42,7 @@ import {IProcedureModel} from './interfaces/i_procedure_model.js'; import {Msg} from './msg.js'; import {Names} from './names.js'; import {ObservableProcedureMap} from './observable_procedure_map.js'; +import * as deprecation from './utils/deprecation.js'; import type {FlyoutItemInfo} from './utils/toolbox.js'; import * as utilsXml from './utils/xml.js'; import * as Variables from './variables.js'; @@ -355,6 +356,12 @@ export function flyoutCategory( useXml = true, ): Element[] | FlyoutItemInfo[] { if (useXml) { + deprecation.warn( + 'The XML return value of Blockly.Procedures.flyoutCategory()', + 'v12', + 'v13', + 'the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead.', + ); return xmlFlyoutCategory(workspace); } const blocks = []; diff --git a/core/variables.ts b/core/variables.ts index 5407a0906a..c896efd0f1 100644 --- a/core/variables.ts +++ b/core/variables.ts @@ -13,6 +13,7 @@ import {isLegacyProcedureDefBlock} from './interfaces/i_legacy_procedure_blocks. import {isVariableBackedParameterModel} from './interfaces/i_variable_backed_parameter_model.js'; import {IVariableModel, IVariableState} from './interfaces/i_variable_model.js'; import {Msg} from './msg.js'; +import * as deprecation from './utils/deprecation.js'; import type {BlockInfo, FlyoutItemInfo} from './utils/toolbox.js'; import * as utilsXml from './utils/xml.js'; import type {Workspace} from './workspace.js'; @@ -124,6 +125,12 @@ export function flyoutCategory( } if (useXml) { + deprecation.warn( + 'The XML return value of Blockly.Variables.flyoutCategory()', + 'v12', + 'v13', + 'the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead.', + ); return xmlFlyoutCategory(workspace); } diff --git a/core/variables_dynamic.ts b/core/variables_dynamic.ts index 994ab83a11..4e2682ce8e 100644 --- a/core/variables_dynamic.ts +++ b/core/variables_dynamic.ts @@ -9,6 +9,7 @@ import {Blocks} from './blocks.js'; import type {FlyoutButton} from './flyout_button.js'; import {Msg} from './msg.js'; +import * as deprecation from './utils/deprecation.js'; import type {FlyoutItemInfo} from './utils/toolbox.js'; import * as xml from './utils/xml.js'; import * as Variables from './variables.js'; @@ -107,6 +108,12 @@ export function flyoutCategory( } if (useXml) { + deprecation.warn( + 'The XML return value of Blockly.VariablesDynamic.flyoutCategory()', + 'v12', + 'v13', + 'the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead.', + ); return xmlFlyoutCategory(workspace); }