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

chore: Fix inadvertent block migration inconsistencies #5780

Merged
merged 3 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions blocks/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
goog.module('Blockly.blocks.colour');

const {defineBlocksWithJsonArray} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
goog.require('Blockly.FieldColour');


defineBlocksWithJsonArray([
Expand Down
2 changes: 2 additions & 0 deletions blocks/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const {Mutator} = goog.require('Blockly.Mutator');
/* eslint-disable-next-line no-unused-vars */
const {Workspace} = goog.requireType('Blockly.Workspace');
const {defineBlocksWithJsonArray} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
goog.require('Blockly.FieldDropdown');


defineBlocksWithJsonArray([
Expand Down
4 changes: 2 additions & 2 deletions blocks/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ goog.module('Blockly.blocks.logic');
const AbstractEvent = goog.requireType('Blockly.Events.Abstract');
const Events = goog.require('Blockly.Events');
const Extensions = goog.require('Blockly.Extensions');
const common = goog.require('Blockly.common');
const xmlUtils = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
Expand All @@ -26,13 +25,14 @@ const {Mutator} = goog.require('Blockly.Mutator');
const {RenderedConnection} = goog.requireType('Blockly.RenderedConnection');
/* eslint-disable-next-line no-unused-vars */
const {Workspace} = goog.requireType('Blockly.Workspace');
const {defineBlocksWithJsonArray} = goog.require('Blockly.common');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great: this was bothering me even though it wasn't hurting anything.

/** @suppress {extraRequire} */
goog.require('Blockly.FieldDropdown');
/** @suppress {extraRequire} */
goog.require('Blockly.FieldLabel');


common.defineBlocksWithJsonArray([
defineBlocksWithJsonArray([
// Block for boolean data type: true and false.
{
'type': 'logic_boolean',
Expand Down
4 changes: 2 additions & 2 deletions blocks/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
goog.module('Blockly.blocks.math');

const Extensions = goog.require('Blockly.Extensions');
// N.B.: Blockly.FieldDropdown needed for type AND side-effects.
/* eslint-disable-next-line no-unused-vars */
const FieldDropdown = goog.require('Blockly.FieldDropdown');
const xmlUtils = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// N.B.: Blockly.FieldDropdown needed for type AND side-effects.
/* eslint-disable-next-line no-unused-vars */
const FieldDropdown = goog.require('Blockly.FieldDropdown');
const {defineBlocksWithJsonArray} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
goog.require('Blockly.FieldLabel');
Expand Down
12 changes: 6 additions & 6 deletions blocks/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ goog.require('Blockly.Warning');
* Common properties for the procedure_defnoreturn and
* procedure_defreturn blocks.
*/
const procedureDef = {
const PROCEDURE_DEF_COMMON = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

/**
* Add or remove the statement block from this function definition.
* @param {boolean} hasStatements True if a statement block is needed.
Expand Down Expand Up @@ -438,7 +438,7 @@ const procedureDef = {
};

Blocks['procedures_defnoreturn'] = {
...procedureDef,
...PROCEDURE_DEF_COMMON,
/**
* Block for defining a procedure with no return value.
* @this {Block}
Expand Down Expand Up @@ -480,7 +480,7 @@ Blocks['procedures_defnoreturn'] = {
};

Blocks['procedures_defreturn'] = {
...procedureDef,
...PROCEDURE_DEF_COMMON,
/**
* Block for defining a procedure with a return value.
* @this {Block}
Expand Down Expand Up @@ -659,7 +659,7 @@ Blocks['procedures_mutatorarg'] = {
* Common properties for the procedure_callnoreturn and
* procedure_callreturn blocks.
*/
const procedureCall = {
const PROCEDURE_CALL_COMMON = {
/**
* Returns the name of the procedure this block calls.
* @return {string} Procedure name.
Expand Down Expand Up @@ -1034,7 +1034,7 @@ const procedureCall = {
};

Blocks['procedures_callnoreturn'] = {
...procedureCall,
...PROCEDURE_CALL_COMMON,
/**
* Block for calling a procedure with no return value.
* @this {Block}
Expand All @@ -1057,7 +1057,7 @@ Blocks['procedures_callnoreturn'] = {
};

Blocks['procedures_callreturn'] = {
...procedureCall,
...PROCEDURE_CALL_COMMON,
/**
* Block for calling a procedure with a return value.
* @this {Block}
Expand Down
2 changes: 1 addition & 1 deletion scripts/gulpfiles/chunks.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"./core/renderers/zelos/zelos.js",
"./core/toolbox/collapsible_category.js",
"./core/field_angle.js",
"./core/field_colour.js",
"./core/field_label_serializable.js",
"./core/flyout_metrics_manager.js",
"./core/flyout_base.js",
Expand All @@ -61,6 +60,7 @@
"./core/field_number.js",
"./core/field_multilineinput.js",
"./core/field_dropdown.js",
"./core/field_colour.js",
"./core/field_checkbox.js",
"./core/field_textinput.js",
"./core/field_image.js",
Expand Down
4 changes: 2 additions & 2 deletions tests/deps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.