fix: typo in unregisterWorkspace (#9936)

* fix: Fix typo in unregisterWorkspace function name

* fix: Add deprecation warning for unregisterWorkpace function

* fix: Add renaming entry for unregisterWorkspace in version 13.0.0

* fix(typo): "." -> "," in renamings.json5

Co-authored-by: Maribeth Moffatt <mebottorff@gmail.com>

* fix(workspace): Correct typo in `unregisterWorkspace` method call

* chore: change v12 to v13

* chore: update import

---------

Co-authored-by: Woosuk Nam <me@suk.kr>
This commit is contained in:
Maribeth Moffatt
2026-05-26 17:18:46 -04:00
committed by GitHub
parent c587882ff9
commit 938d1fa5f2
3 changed files with 31 additions and 2 deletions
+19 -1
View File
@@ -15,6 +15,7 @@ import * as eventUtils from './events/utils.js';
import {getFocusManager} from './focus_manager.js';
import {ISelectable, isSelectable} from './interfaces/i_selectable.js';
import {ShortcutRegistry} from './shortcut_registry.js';
import * as deprecation from './utils/deprecation.js';
import type {Workspace} from './workspace.js';
import type {WorkspaceSvg} from './workspace_svg.js';
@@ -58,10 +59,27 @@ export function registerWorkspace(workspace: Workspace) {
*
* @param workspace
*/
export function unregisterWorkpace(workspace: Workspace) {
export function unregisterWorkspace(workspace: Workspace) {
delete WorkspaceDB_[workspace.id];
}
/**
* Unregister a workspace from the workspace db.
*
* @deprecated v13: use Blockly.common.unregisterWorkspace
* @param workspace
*/
export function unregisterWorkpace(workspace: Workspace) {
deprecation.warn(
'Blockly.common.unregisterWorkpace',
'v13',
'v14',
'Blockly.common.unregisterWorkspace',
);
unregisterWorkspace(workspace);
}
/**
* The main workspace most recently used.
* Set by Blockly.WorkspaceSvg.prototype.markFocused
+1 -1
View File
@@ -167,7 +167,7 @@ export class Workspace {
this.listeners.length = 0;
this.clear();
// Remove from workspace database.
common.unregisterWorkpace(this);
common.unregisterWorkspace(this);
}
/**
@@ -1595,5 +1595,16 @@
},
],
'13.0.0': [
{
oldName: 'Blockly.common',
exports: {
unregisterWorkpace: {
newExport: 'unregisterWorkspace',
},
},
},
],
'develop': [],
}