8000 Deprecated warning suggests code that doesn't work! · Issue #9184 · google/blockly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
  • Deprecated warning suggests code that doesn't work! #9184
    Open
    @lizlooney

    Description

    @lizlooney

    Check for duplicates

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

    Description

    I had code that called workspace.getVariableUsesById(id). The deprecation warning says to use Blockly.Workspace.getVariableMap().getVariableUsesById, but that doesn't work.

    workspace.getVariableMap() returns an IVariableMap<IVariableModel<IVariableState>>, but IVariableMap does not have a function named getVariableUsesById.

    Reproduction steps

    1. Write code that uses workspace.getVariableUsesById(id)
    2. Run it and look at the browser console. See Blockly.Workspace.getVariableUsesById was deprecated in v12 and will be deleted in v13. Use Blockly.Workspace.getVariableMap().getVariableUsesById instead.
    3. Replace code with workspace.getVariableMap().getVariableUsesById (id).
    4. Observe error (in my case I see this error in vscode): Property 'getVariableUsesById' does not exist on type 'IVariableMap<IVariableModel<IVariableState>>'. Did you mean 'getVariableById'?

    Stack trace

    Screenshots

    No response

    Browsers

    No response

    Metadata

    Metadata

    Assignees

    Labels

    issue: bugDescribes why the code or behaviour is wrong

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0