Skip to content

Remove remaining calls to deprecated variable map methods #8945

@cpcallen

Description

@cpcallen

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

PR #8401 deprecated certain …ById methods on VariableMap, and PR #8415 subsequently deprecated related wrapper methods on Workspace, with PR #8946 completing the refactor by removing the overriding versions of those methods on WorkspaceSvg as well as replacing a number of the remaining calls to those methods from code in core/.

There remain a number of places where these deprecated methods (both the Workspace.…Variable… methods and the VariableMap.…ById methods) are called from elsewhere in the codebase which should be updated to use non-deprecated methods.

A quick search for these using:

find . -name node_modules -prune -o -name build -prune -o -name dist -prune -o -name '*.[tj]s' -print0 -o -name '*.html' -print0 |xargs -0 grep -c '\(workspace\.createVariable\|\.renameVariableById\|\.deleteVariableById\|\.getAllVariableNames\|\.getVariableUsesById\)('  |grep -v ':0$'

returns:

  • ./blocks/procedures.ts: 2
  • ./core/workspace.ts: 1
  • ./core/variable_map.ts: 2
  • ./core/xml.ts: 1
  • ./core/variables.ts: 4
  • ./core/events/events_var_delete.ts: 2
  • ./core/events/events_var_create.ts: 2
  • ./core/events/events_var_rename.ts: 2
  • ./core/workspace_svg.ts: 2
  • ./tests/mocha/blocks/procedures_test.js: 8
  • ./tests/mocha/blocks/variables_test.js: 12
  • ./tests/mocha/event_test.js: 2
  • ./tests/mocha/block_test.js: 3
  • ./tests/mocha/field_variable_test.js: 18
  • ./tests/mocha/variable_map_test.js: 5
  • ./tests/mocha/jso_serialization_test.js: 2
  • ./tests/mocha/xml_test.js: 6
  • ./tests/mocha/test_helpers/workspace.js: 56

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions