-
Notifications
You must be signed in to change notification settings - Fork 3.8k
refactor!: Finish refactor of WorkspaceSvg
VariableMap
methods
#8946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 tasks
Delete the following methods from WorkspaceSvg: - renameVariableById - deleteVariableById - createVariable Modify the following methods on VariableMap to call this.workspace.refreshToolboxSelection() if this.workspace is a WorkspaceSvg, replicating the behaviour of the aforementioned deleted methods and additionally ensuring that that method is called following any change to the variable map: - renameVariable - changeVariableType - renameVariableAndUses - createVariable - addVariable - deleteVariable BREAKING CHANGE: This change ensures that the toolbox will be refreshed regardless of what route the VaribleMap was updated, rather than only being refreshed when it is updated via calls to methods on WorkspaceSvg. Overall this is much more likely to fix a bug (where the toolbox wasn't being refreshed when it should have been) than cause one (by refreshing the toolbox when it shouldn't be), but this is still a behaviour change which could _conceivably_ result an unexpected regression.
Also refactor to use named imports core/variables.ts methods.
d114b6e
to
fe1ba5c
Compare
bef89dd
to
bb811d8
Compare
gonfunko
approved these changes
May 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
Used to mark a PR or issue that changes our public APIs.
component: variables
PR: refactor
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Fixes closure compiler warnings for calls to deprecated methods.
Part of #8945.
Proposed Changes
Delete the following methods from
WorkspaceSvg
:renameVariableById
deleteVariableById
createVariable
Modify the following methods on
VariableMap
to callthis.workspace.refreshToolboxSelection()
if this.workspace is aWorkspaceSvg
, replicating the behaviour of the aforementioned deleted methods and additionally ensuring that that method is called following any change to the variable map:renameVariable
changeVariableType
renameVariableAndUses
createVariable
addVariable
deleteVariable
Additionally, refactor remaining calls to deprecated
Workspace
variable methods incore/
, and improve consistency of use of@deprecated
JSDoc tag.Reason for Changes
PR #8401 deprecated certain
…ById
methods onVariableMap
, and PR #8415 subsequently deprecated related wrapper methods onWorkspace
, but the versions of these methods onWorkspaceSvg
were not deprecated despite continuing to call the deprecated superclass versions.Test Coverage
Passes
npm test
and some manual sanity checking of variable field behaviour.Documentation
Deprecation of variable-related methods on
Workspace
worth calling out in release notes.Additional Information
Opened #8945 to track remaining (non-
core/
) cleanup from this series of refactors/deprecations.BREAKING CHANGE:
This change ensures that the toolbox will be refreshed regardless of what route the
VaribleMap
was updated, rather than only being refreshed when it is updated via calls to methods onWorkspaceSvg
.Overall this is much more likely to fix a bug (where the toolbox wasn't being refreshed when it should have been) than cause one (by refreshing the toolbox when it shouldn't be), but this is still a behaviour change which could conceivably result an
unexpected regression.