-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
blockly.js is full of public stuff that doesn't really fit on any namespace. This is a problem because internal code requiring it causes circular dependencies.
The fix is to move everything in blockly.js out into separate files and require those from inside the codebase, while leaving aliases behind in blockly.js for anything that should stay publicly accessible.
In some cases, we also need setters so that external code can change those values.
In other cases, properties should just not be exported.
This issue is for tracking decisions about these properties and whether those decisions have been implemented.
Needs decision:
-
hideChaff -
alert -
confirm -
prompt -
hueToHex
Can be internal:
-
Blockly.jsonInitFactory_ -
clipboardXml_->clipboard.jsin Move clipboard functions to a separate namespace #5237 -
clipboardSource_->clipboard.jsin Move clipboard functions to a separate namespace #5237 -
clipboardTypeCounts_->clipboard.jsin Move clipboard functions to a separate namespace #5237 -
parentContainer->common.jsin More cleanup of blockly.js #5262 -
draggingConnections->common.jsin More cleanup of blockly.js #5262 -
onKeyDown->inject.jsin refactor: Migrate Blockly.onKeyDown out of blockly.js #5476
Exported function, but moved to a different file and aliased.
-
bindEvent_->Blockly.browserEvents.bindin Move bind/unbind events functions to new file, with example usage. #4642 (2021Q1) -
getMainWorkspace->Blockly.common.getMainWorkspacein Move main workspace to a new file, common.js #5244 -
copy->Blockly.clipboard.copyin Move clipboard functions to a separate namespace #5237, and tracking remaining work in Keyboard nav uses non-public properties in paste blockly-samples#833 -
paste ->Blockly.clipboard.paste` in Move clipboard functions to a separate namespace #5237, and tracking remaining work in Keyboard nav uses non-public properties in paste blockly-samples#833 -
duplicate->Blockly.clipboard.duplicatein Move clipboard functions to a separate namespace #5237, and tracking remaining work in Keyboard nav uses non-public properties in paste blockly-samples#833 -
setParentContainer->Blockly.common.setParentContainerin More cleanup of blockly.js #5262 -
hueToHex->Blockly.utils.colour.hueToHexin Migrate Blockly.hueToHex to Blockly.utils.colour.hueToHex #5462 -
alert->Blockly.dialog.alertin Move alert/confirm/prompt to a new file, dialog.js #5457 -
confirm->Blockly.dialog.confirmin Move alert/confirm/prompt to a new file, dialog.js #5457 -
prompt->Blockly.dialog.promptin Move alert/confirm/prompt to a new file, dialog.js #5457 -
deleteBlock->Blockly.BlockSvg.checkAndDeletein refactor: move Blockly.deleteBlock out of blockly.js #5483 -
svgResize->Blockly.common.svgResizein refactor: Move Blockly.svgResize to Blockly.common #5485
Exported function, used only externally and therefore left in blockly.js:
-
isNumber: Used in generators -
defineBlocksWithJsonArray: Used in block definitions -
svgSize: Deprecated already, and marked for removal in March 2022 -
resizeSvgContents
Exported read-only property:
- [ ]
Exported settable property:
-
mainWorkspacein Move main workspace to a new file, common.js #5244, with a follow-up to add deprecation warnings.
Can be removed:
-
checkBlockColourConstants: Only used internally, and as a deprecation helper for an old deprecation. Deleted in More cleanup of blockly.js #5262. -
checkBlockColourConstant_: Only used by `checkBlockColourConstants. Deleted in More cleanup of blockly.js #5262. -
cache3dSupported_: Not used. Deleted in More cleanup of blockly.js #5262. -
onContextMenu_: Not used. Deleted in refactor: remove unused Blockly.onContextMenu_ #5480.