blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

Replace calls to `Workspace.variableMethod` with calls to `Workspace.getVariableMap().variableMethod`

Open rpbourret opened this issue 2 months ago • 1 comments

Check for duplicates

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

Component

The following plugins:

  • Shareable procedure blocks
  • Plus-minus mutator blocks
  • Typed variable modal
  • Block test

Description

PR 8415 deprecated a number of methods on Workspace that pass calls to VariableMap. The deprecations recommend replacing calls to Workspace.variableMethod with calls to Workspace.getVariableMap().variableMethod.

The following files have calls that need to be replaced:

Workspace.createVariable

  • plugins/block-shareable-procedures/src/observable_parameter_model.ts (two occurrences)
  • plugins/block-shareable-procedures/test/data_models.mocha.js (two occurrences)
  • plugins/block-shareable-procedures/test/procedure_blocks.mocha.js (two occurrences)
  • plugins/block-plus-minus/src/procedures.js
  • plugins/block-plus-minus/test/procedures.mocha.js (two occurrences)
  • plugins/typed-variable-modal/src/TypedVariableModal.js
  • plugins/block-test/src/fields/validators.js (five occurrences)

Workspace.getVariablesOfType

  • plugins/block-plus-minus/test/procedures.mocha.js
  • plugins/block-shareable-procedures/test/procedure_blocks.mocha.js

Reproduction steps

Stack trace


Screenshots

No response

rpbourret avatar Oct 28 '25 22:10 rpbourret

@tashee Is this an issue you can work/focus on?

sappm01 avatar Oct 31 '25 16:10 sappm01