Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion core/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 { deprecation } from './utils.js';
import type {Workspace} from './workspace.js';
import type {WorkspaceSvg} from './workspace_svg.js';

Expand Down Expand Up @@ -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 v12: use Blockly.common.unregisterWorkspace
* @param workspace
*/
export function unregisterWorkpace(workspace: Workspace) {
deprecation.warn(
'Blockly.common.unregisterWorkpace',
'v12',
'v13',
'Blockly.common.unregisterWorkspace',
);

unregisterWorkspace(workspace);
}

/**
* The main workspace most recently used.
* Set by Blockly.WorkspaceSvg.prototype.markFocused
Expand Down
11 changes: 11 additions & 0 deletions scripts/migration/renamings.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1595,5 +1595,16 @@
},
],

'13.0.0': [
{
oldName: 'Blockly.common',
exports: {
unregisterWorkpace: {
newExport: 'unregisterWorkspace'.
},
},
},
],

'develop': [],
}