Skip to content

Commit

Permalink
chore: Add deprecation notices.
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko committed Jan 8, 2025
1 parent aff572d commit f39d232
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/procedures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 = [];
Expand Down
7 changes: 7 additions & 0 deletions core/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}

Expand Down
7 changes: 7 additions & 0 deletions core/variables_dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit f39d232

Please sign in to comment.