Skip to content
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

refactor: Migrate to Blockly.Events.Abstract to named exports #5916

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions core/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
goog.module('Blockly.Block');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const Extensions = goog.require('Blockly.Extensions');
const Tooltip = goog.require('Blockly.Tooltip');
const arrayUtils = goog.require('Blockly.utils.array');
Expand All @@ -27,6 +25,8 @@ const fieldRegistry = goog.require('Blockly.fieldRegistry');
const idGenerator = goog.require('Blockly.utils.idGenerator');
const object = goog.require('Blockly.utils.object');
const parsing = goog.require('Blockly.utils.parsing');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
const {Align, Input} = goog.require('Blockly.Input');
const {ASTNode} = goog.require('Blockly.ASTNode');
const {Blocks} = goog.require('Blockly.blocks');
Expand Down
4 changes: 2 additions & 2 deletions core/bump_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
goog.module('Blockly.bumpObjects');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const eventUtils = goog.require('Blockly.Events.utils');
const mathUtils = goog.require('Blockly.utils.math');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {BlockSvg} = goog.requireType('Blockly.BlockSvg');
/* eslint-disable-next-line no-unused-vars */
const {IBoundedElement} = goog.requireType('Blockly.IBoundedElement');
Expand Down
2 changes: 1 addition & 1 deletion core/events/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
goog.module('Blockly.Events');

const Abstract = goog.require('Blockly.Events.Abstract');
const deprecation = goog.require('Blockly.utils.deprecation');
const eventUtils = goog.require('Blockly.Events.utils');
const {Abstract} = goog.require('Blockly.Events.Abstract');
const {BlockBase} = goog.require('Blockly.Events.BlockBase');
const {BlockChange} = goog.require('Blockly.Events.BlockChange');
const {BlockCreate} = goog.require('Blockly.Events.BlockCreate');
Expand Down
2 changes: 1 addition & 1 deletion core/events/events_abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ Abstract.prototype.getEventWorkspace_ = function() {
return workspace;
};

exports = Abstract;
exports.Abstract = Abstract;
2 changes: 1 addition & 1 deletion core/events/events_block_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
goog.module('Blockly.Events.BlockBase');

const Abstract = goog.require('Blockly.Events.Abstract');
const object = goog.require('Blockly.utils.object');
const {Abstract} = goog.require('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');

Expand Down
6 changes: 3 additions & 3 deletions core/events/events_comment_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
goog.module('Blockly.Events.CommentBase');

const AbstractEvents = goog.require('Blockly.Events.Abstract');
const Xml = goog.require('Blockly.Xml');
const eventUtils = goog.require('Blockly.Events.utils');
const object = goog.require('Blockly.utils.object');
const utilsXml = goog.require('Blockly.utils.xml');
const {Abstract} = goog.require('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {CommentCreate} = goog.requireType('Blockly.Events.CommentCreate');
/* eslint-disable-next-line no-unused-vars */
Expand All @@ -32,7 +32,7 @@ const {WorkspaceComment} = goog.requireType('Blockly.WorkspaceComment');
* Abstract class for a comment event.
* @param {!WorkspaceComment=} opt_comment The comment this event
* corresponds to. Undefined for a blank event.
* @extends {AbstractEvents}
* @extends {Abstract}
* @constructor
* @alias Blockly.Events.CommentBase
*/
Expand Down Expand Up @@ -69,7 +69,7 @@ const CommentBase = function(opt_comment) {
*/
this.recordUndo = eventUtils.getRecordUndo();
};
object.inherits(CommentBase, AbstractEvents);
object.inherits(CommentBase, Abstract);

/**
* Encode the event as JSON.
Expand Down
2 changes: 1 addition & 1 deletion core/events/events_ui_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
goog.module('Blockly.Events.UiBase');

const Abstract = goog.require('Blockly.Events.Abstract');
const object = goog.require('Blockly.utils.object');
const {Abstract} = goog.require('Blockly.Events.Abstract');


/**
Expand Down
2 changes: 1 addition & 1 deletion core/events/events_var_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
goog.module('Blockly.Events.VarBase');

const Abstract = goog.require('Blockly.Events.Abstract');
const object = goog.require('Blockly.utils.object');
const {Abstract} = goog.require('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {VariableModel} = goog.requireType('Blockly.VariableModel');

Expand Down
4 changes: 2 additions & 2 deletions core/events/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
*/
goog.module('Blockly.Events.utils');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const idGenerator = goog.require('Blockly.utils.idGenerator');
const registry = goog.require('Blockly.registry');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {BlockCreate} = goog.requireType('Blockly.Events.BlockCreate');
/* eslint-disable-next-line no-unused-vars */
const {BlockMove} = goog.requireType('Blockly.Events.BlockMove');
Expand Down
2 changes: 1 addition & 1 deletion core/events/workspace_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
goog.module('Blockly.Events.FinishedLoading');

const Abstract = goog.require('Blockly.Events.Abstract');
const eventUtils = goog.require('Blockly.Events.utils');
const object = goog.require('Blockly.utils.object');
const registry = goog.require('Blockly.registry');
const {Abstract} = goog.require('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {Workspace} = goog.requireType('Blockly.Workspace');

Expand Down
4 changes: 2 additions & 2 deletions core/mutator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/
goog.module('Blockly.Mutator');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const dom = goog.require('Blockly.utils.dom');
const eventUtils = goog.require('Blockly.Events.utils');
const internalConstants = goog.require('Blockly.internalConstants');
const toolbox = goog.require('Blockly.utils.toolbox');
const xml = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
const {BlockChange} = goog.require('Blockly.Events.BlockChange');
/* eslint-disable-next-line no-unused-vars */
const {BlockSvg} = goog.requireType('Blockly.BlockSvg');
Expand Down
4 changes: 2 additions & 2 deletions core/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
goog.module('Blockly.Procedures');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const Variables = goog.require('Blockly.Variables');
const Xml = goog.require('Blockly.Xml');
const eventUtils = goog.require('Blockly.Events.utils');
const utilsXml = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
const {Blocks} = goog.require('Blockly.blocks');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
Expand Down
2 changes: 1 addition & 1 deletion core/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
goog.module('Blockly.registry');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {Cursor} = goog.requireType('Blockly.Cursor');
/* eslint-disable-next-line no-unused-vars */
Expand Down
4 changes: 2 additions & 2 deletions core/trashcan.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
goog.module('Blockly.Trashcan');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const blocks = goog.requireType('Blockly.serialization.blocks');
const browserEvents = goog.require('Blockly.browserEvents');
Expand All @@ -27,6 +25,8 @@ const registry = goog.require('Blockly.registry');
const toolbox = goog.require('Blockly.utils.toolbox');
const uiPosition = goog.require('Blockly.uiPosition');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {BlocklyOptions} = goog.requireType('Blockly.BlocklyOptions');
const {ComponentManager} = goog.require('Blockly.ComponentManager');
const {DeleteArea} = goog.require('Blockly.DeleteArea');
Expand Down
4 changes: 2 additions & 2 deletions core/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
goog.module('Blockly.Workspace');

/* eslint-disable-next-line no-unused-vars */
const Abstract = goog.requireType('Blockly.Events.Abstract');
const arrayUtils = goog.require('Blockly.utils.array');
const eventUtils = goog.require('Blockly.Events.utils');
const idGenerator = goog.require('Blockly.utils.idGenerator');
Expand All @@ -25,6 +23,8 @@ const registry = goog.require('Blockly.registry');
/* eslint-disable-next-line no-unused-vars */
const toolbox = goog.requireType('Blockly.utils.toolbox');
/* eslint-disable-next-line no-unused-vars */
const {Abstract} = goog.requireType('Blockly.Events.Abstract');
/* eslint-disable-next-line no-unused-vars */
const {BlocklyOptions} = goog.requireType('Blockly.BlocklyOptions');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
Expand Down
78 changes: 39 additions & 39 deletions scripts/gulpfiles/chunks.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
"./core/field_checkbox.js",
"./core/field_angle.js",
"./core/toolbox/collapsible_category.js",
"./core/renderers/zelos/measurables/top_row.js",
"./core/renderers/zelos/measurables/inputs.js",
"./core/renderers/zelos/measurables/row_elements.js",
"./core/renderers/zelos/marker_svg.js",
"./core/renderers/zelos/renderer.js",
"./core/field_textinput.js",
"./core/field_image.js",
"./core/renderers/zelos/info.js",
"./core/renderers/zelos/path_object.js",
"./core/renderers/zelos/drawer.js",
"./core/renderers/zelos/constants.js",
"./core/renderers/zelos/measurables/bottom_row.js",
"./core/renderers/zelos/zelos.js",
"./core/renderers/thrasos/renderer.js",
"./core/renderers/thrasos/info.js",
Expand Down Expand Up @@ -76,18 +64,23 @@
"./core/utils/useragent.js",
"./core/utils/svg.js",
"./core/utils/dom.js",
"./core/utils/idgenerator.js",
"./core/connection_checker.js",
"./core/keyboard_nav/ast_node.js",
"./core/keyboard_nav/cursor.js",
"./core/registry.js",
"./core/toolbox/separator.js",
"./core/toolbox/toolbox_item.js",
"./core/interfaces/i_selectable_toolbox_item.js",
"./core/interfaces/i_collapsible_toolbox_item.js",
"./core/toolbox/category.js",
"./core/serialization/exceptions.js",
"./core/interfaces/i_serializer.js",
"./core/serialization/registry.js",
"./core/serialization/priorities.js",
"./core/serialization/blocks.js",
"./core/utils/toolbox.js",
"./core/utils/math.js",
"./core/utils/idgenerator.js",
"./core/utils/array.js",
"./core/workspace.js",
"./core/utils/object.js",
"./core/events/events_block_delete.js",
"./core/toolbox/separator.js",
"./core/toolbox/toolbox_item.js",
"./core/keyboard_nav/basic_cursor.js",
"./core/keyboard_nav/tab_navigate_cursor.js",
"./core/warning.js",
Expand Down Expand Up @@ -128,11 +121,25 @@
"./core/options.js",
"./core/interfaces/i_bounded_element.js",
"./core/grid.js",
"./core/css.js",
"./core/flyout_button.js",
"./core/contextmenu_registry.js",
"./core/theme/classic.js",
"./core/blockly_options.js",
"./core/utils.js",
"./core/renderers/zelos/measurables/top_row.js",
"./core/renderers/zelos/measurables/row_elements.js",
"./core/renderers/zelos/marker_svg.js",
"./core/renderers/zelos/measurables/inputs.js",
"./core/renderers/zelos/path_object.js",
"./core/renderers/zelos/drawer.js",
"./core/renderers/zelos/renderer.js",
"./core/utils/aria.js",
"./core/field_textinput.js",
"./core/field_image.js",
"./core/renderers/zelos/constants.js",
"./core/renderers/zelos/measurables/bottom_row.js",
"./core/renderers/zelos/info.js",
"./core/renderers/measurables/top_row.js",
"./core/renderers/measurables/statement_input.js",
"./core/renderers/measurables/square_corner.js",
Expand All @@ -155,8 +162,11 @@
"./core/renderers/measurables/input_row.js",
"./core/renderers/measurables/inline_input.js",
"./core/scrollbar.js",
"./core/interfaces/i_toolbox_item.js",
"./core/interfaces/i_toolbox.js",
"./core/utils/metrics.js",
"./core/interfaces/i_metrics_manager.js",
"./core/interfaces/i_flyout.js",
"./core/metrics_manager.js",
"./core/interfaces/i_deletable.js",
"./core/interfaces/i_draggable.js",
Expand Down Expand Up @@ -186,14 +196,15 @@
"./core/events/events_var_delete.js",
"./core/variable_map.js",
"./core/names.js",
"./core/events/events_block_base.js",
"./core/events/events_block_change.js",
"./core/events/events_ui_base.js",
"./core/events/events_marker_move.js",
"./core/renderers/common/marker_svg.js",
"./core/keyboard_nav/marker.js",
"./core/keyboard_nav/ast_node.js",
"./core/keyboard_nav/cursor.js",
"./core/marker_manager.js",
"./core/field_label.js",
"./core/input_types.js",
"./core/interfaces/i_registrable_field.js",
"./core/field_registry.js",
"./core/input.js",
Expand All @@ -216,8 +227,10 @@
"./core/procedures.js",
"./core/workspace_svg.js",
"./core/utils/rect.js",
"./core/utils/size.js",
"./core/utils/coordinate.js",
"./core/utils/style.js",
"./core/utils/deprecation.js",
"./core/utils/svg_math.js",
"./core/bubble_dragger.js",
"./core/block_animations.js",
Expand All @@ -226,23 +239,9 @@
"./core/browser_events.js",
"./core/tooltip.js",
"./core/block_svg.js",
"./core/interfaces/i_flyout.js",
"./core/interfaces/i_toolbox.js",
"./core/interfaces/i_toolbox_item.js",
"./core/interfaces/i_selectable_toolbox_item.js",
"./core/interfaces/i_collapsible_toolbox_item.js",
"./core/utils/aria.js",
"./core/utils/deprecation.js",
"./core/css.js",
"./core/toolbox/category.js",
"./core/input_types.js",
"./core/utils/size.js",
"./core/serialization/exceptions.js",
"./core/interfaces/i_serializer.js",
"./core/serialization/registry.js",
"./core/serialization/priorities.js",
"./core/serialization/blocks.js",
"./core/utils/toolbox.js",
"./core/events/events_block_base.js",
"./core/events/events_block_change.js",
"./core/utils/xml.js",
"./core/connection_type.js",
"./core/internal_constants.js",
"./core/mutator.js",
Expand All @@ -252,13 +251,14 @@
"./core/extensions.js",
"./core/block.js",
"./core/utils/string.js",
"./core/utils/object.js",
"./core/dialog.js",
"./core/utils/xml.js",
"./core/events/events_var_base.js",
"./core/events/events_var_create.js",
"./core/variable_model.js",
"./core/variables.js",
"./core/events/events_abstract.js",
"./core/registry.js",
"./core/events/utils.js",
"./core/xml.js",
"./core/connection.js",
Expand Down