Files
blockly/scripts/migration/renamings.js
Himanshu 3629ed5f65 refactor: Rename Blockly.connectionTypes to Blockly.ConnectionType (#5407)
* Renamed Blockly.connectionTypes to Blockly.ConnectionType
* Renamed core/connection_types.js to connection_type.js
* Add entry to renamings.js for renaming of Blockly.connectionTypes

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2021-09-24 12:45:10 +01:00

146 lines
4.1 KiB
JavaScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Collected information about modules and module
* exports that have been renamed between versions.
*
* For now this is a node module, not a goog.module.
*/
'use strict';
/**
* Map from Blockly core version number to table of renamings made
* *since* that version was released (since we don't know for sure
* what the version number of the release that will incorporate those
* renamings will be yet).
* @type {Object<string, ?>}
*/
const renamings = {
'4.20201217.0': {
'Blockly': {
exports: {
// bind/unbind events functions. See PR #4642
EventData: {module: 'Blockly.eventHandling', export: 'Data'},
bindEvent_: {module: 'Blockly.browserEvents', export: 'bind'},
unbindEvent_: {module: 'Blockly.browserEvents', export: 'unbind'},
bindEventWithChecks_: {
module: 'Blockly.browserEvents',
export: 'conditionalBind',
},
},
},
},
'6.20210701.0': {
'Blockly': {
exports: {
// Clipboard. See PR #5237.
clipboardXml_: {module: 'Blockly.clipboard', export: 'xml'},
clipboardSource_: {module: 'Blockly.clipboard', export: 'source'},
clipboardTypeCounts_: {
module: 'Blockly.clipboard',
export: 'typeCounts',
},
copy: {module: 'Blockly.clipboard'},
paste: {module: 'Blockly.clipboard'},
duplicate: {module: 'Blockly.clipboard'},
// mainWorkspace. See PR #5244.
mainWorkspace: {
module: 'Blockly.common',
get: 'getMainWorkspace',
set: 'setMainWorkspace',
},
getMainWorkspace: {module: 'Blockly.common'},
// parentContainer, draggingConnections. See PR #5262.
parentContainer: {
module: 'Blockly.common',
get: 'getParentContainer',
set: 'setParentContainer',
},
setParentContainer: {module: 'Blockly.common'},
draggingConnections: {module: 'Blockly.common'},
// Dialogs. See PR #5457.
alert: {
module: 'Blockly.dialog',
export: 'alert',
set: 'setAlert',
},
confirm: {
module: 'Blockly.dialog',
export: 'confirm',
set: 'setConfirm',
},
prompt: {
module: 'Blockly.dialog',
export: 'prompt',
set: 'setPrompt',
},
// hueToHex. See PR #5462.
hueToHex: {module: 'Blockly.utils.colour'},
// Blockly.hideChaff() became
// Blockly.common.getMainWorkspace().hideChaff(). See PR #5460.
// selected. See PR #5489.
selected: {
module: 'Blockly.common',
get: 'getSelected',
set: 'setSelected',
},
},
},
'Blockly.ContextMenu': {
exports: {
currentBlock: {get: 'getCurrentBlock', set: 'setCurrentBlock'},
},
},
'Blockly.Events': {
exports: {
recordUndo: {get: 'getRecordUndo', set: 'setRecordUndo'},
},
},
'Blockly.Tooltip': {
exports: {
DIV: {get: 'getDiv', set: 'setDiv'},
visible: {get: 'isVisible'},
},
},
'Blockly.WidgetDiv': {
exports: {
DIV: {get: 'getDiv'},
},
},
'Blockly.connectionTypes': {
module: 'Blockly.ConnectionType',
},
'Blockly.utils': {
exports: {
genUid: {module: 'Blockly.utils.idGenerator'},
getScrollDelta: {module: 'Blockly.utils.browserEvents'},
isTargetInput: {module: 'Blockly.utils.browserEvents'},
isRightButton: {module: 'Blockly.utils.browserEvents'},
mouseToSvg: {module: 'Blockly.utils.browserEvents'},
},
},
'Blockly.utils.global': {
export: 'globalThis', // Previous default export now named.
},
'Blockly.utils.IdGenerator': {
module: 'Blockly.utils.idGenerator',
},
'Blockly.utils.xml': {
exports: {
// document was a function before, too - not a static property
// or get accessor.
document: {export: 'getDocument'},
},
},
},
};
exports.renamings = renamings;