Skip to content

Commit

Permalink
release: v9.2.0
Browse files Browse the repository at this point in the history
Merge pull request #6711 from google/rc/v9.2.0
  • Loading branch information
cpcallen committed Dec 15, 2022
2 parents 351a696 + eccc594 commit b9e3626
Show file tree
Hide file tree
Showing 183 changed files with 11,712 additions and 7,225 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/tests/compile/*
/tests/jsunit/*
/tests/generators/*
/tests/mocha/run_mocha_tests_in_browser.js
/tests/mocha/webdriver.js
/tests/screenshot/*
/tests/test_runner.js
/tests/workspace_svg/*
Expand Down
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ updates:
target-branch: "develop"
schedule:
interval: "weekly"
ignore:
- dependency-name: "jsdom"
# For jsdom, ignore all updates for version 16.
# We should test that this does not cause issue
# google/blockly-samples#665 when version 17 is released.
versions: "16.x"
commit-message:
prefix: "chore(deps)"
labels:
Expand Down
16 changes: 11 additions & 5 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@ changelog:
exclude:
labels:
- ignore-for-release
- "PR: chore"
authors:
- dependabot
categories:
- title: Breaking Changes 🛠
- title: Breaking changes 🛠
labels:
- breaking change
- title: New Features
- title: Deprecations 🧹 - APIs that may be removed in future releases
labels:
- deprecation
- title: New features ✨
labels:
- "PR: feature"
- title: Bug fixes
- title: Bug fixes 🐛
labels:
- "PR: fix"
- title: Cleanup ♻️
labels:
- "PR: chore"
- "PR: docs"
- "PR: refactor"
- title: Other Changes
- title: Reverted changes ⎌
labels:
- "PR: revert"
- title: Other changes
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/appengine_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
path: _deploy/

- name: Deploy to App Engine
uses: google-github-actions/deploy-appengine@v0.8.2
uses: google-github-actions/deploy-appengine@v1.0.0
# For parameters see:
# https://github.com/google-github-actions/deploy-appengine#inputs
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check_clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: DoozyX/clang-format-lint-action@v0.14
- uses: DoozyX/clang-format-lint-action@v0.15
with:
source: 'core'
extensions: 'js,ts'
# This should be as close as possible to the version that the npm
# package supports. This can be found by running:
# npx clang-format --version.
clangFormatVersion: 13
clangFormatVersion: 15

# The Report clang format workflow (report_clang_format.yml) will
# run (if required) after this one to post a comment to the PR.
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/conventional-label.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
on:
pull_request_target:
types: [ opened, edited ]
types:
- opened
- edited
name: conventional-release-labels
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: bcoe/conventional-release-labels@v1
with:
type_labels: '{"feat": "PR: feature", "fix": "PR: fix", "breaking": "breaking change", "chore": "PR: chore", "docs": "PR: docs", "refactor": "PR: refactor"}'
type_labels: '{"feat": "PR: feature", "fix": "PR: fix", "breaking": "breaking
change", "chore": "PR: chore", "docs": "PR: docs", "refactor": "PR:
refactor", "revert": "PR: revert", "deprecate": "deprecation"}'
ignored_types: '[]'
2 changes: 1 addition & 1 deletion .github/workflows/update_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: source ./tests/scripts/update_metadata.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@b4d51739f96fca8047ad065eccef63442d8e99f7
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
with:
commit-message: Update build artifact sizes in check_metadata.sh
delete-branch: true
Expand Down
11 changes: 11 additions & 0 deletions appengine/blockly_compressed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Added November 2022 after discovering that a number of orgs were hot-linking
// their Blockly applications to https://blockly-demo.appspot.com/
// Delete this file in early 2024.
var msg = 'Compiled Blockly files should be loaded from https://unpkg.com/blockly/\n' +
'For help, contact https://groups.google.com/g/blockly';
console.log(msg);
try {
alert(msg);
} catch (_e) {
// Can't alert? Probably node.js.
}
2 changes: 1 addition & 1 deletion blocks/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ const PROCEDURE_CALL_COMMON = {
Xml.domToWorkspace(xml, this.workspace);
Events.setGroup(false);
}
} else if (event.type === Events.BLOCK_DELETE && event.blockId != this.id) {
} else if (event.type === Events.BLOCK_DELETE) {
// Look for the case where a procedure definition has been deleted,
// leaving this block (a procedure call) orphaned. In this case, delete
// the orphan.
Expand Down
17 changes: 11 additions & 6 deletions core/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export class Block implements IASTNodeLocation, IDeletable {
/** An optional method called during initialization. */
init?: (() => AnyDuringMigration)|null = undefined;

/** An optional method called during disposal. */
destroy?: (() => void) = undefined;

/**
* An optional serialization method for defining how to serialize the
* mutation state to XML. This must be coupled with defining
Expand Down Expand Up @@ -324,16 +327,15 @@ export class Block implements IASTNodeLocation, IDeletable {
if (this.isDeadOrDying()) {
return;
}
// Terminate onchange event calls.
if (this.onchangeWrapper_) {
this.workspace.removeChangeListener(this.onchangeWrapper_);
}

this.unplug(healStack);
if (eventUtils.isEnabled()) {
eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_DELETE))(this));
}

if (this.onchangeWrapper_) {
this.workspace.removeChangeListener(this.onchangeWrapper_);
}

eventUtils.disable();

try {
Expand Down Expand Up @@ -362,6 +364,9 @@ export class Block implements IASTNodeLocation, IDeletable {
}
} finally {
eventUtils.enable();
if (typeof this.destroy === 'function') {
this.destroy();
}
this.disposed = true;
}
}
Expand Down Expand Up @@ -1817,7 +1822,7 @@ export class Block implements IASTNodeLocation, IDeletable {
* @param element The element to try to turn into a field.
* @returns The field defined by the JSON, or null if one couldn't be created.
*/
private fieldFromJson_(element: {alt?: string, type?: string, text?: string}):
private fieldFromJson_(element: {alt?: string, type: string, text?: string}):
Field|null {
const field = fieldRegistry.fromJson(element);
if (!field && element['alt']) {
Expand Down
8 changes: 4 additions & 4 deletions core/block_dragger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class BlockDragger implements IBlockDragger {
* @param currentDragDeltaXY How far the pointer has moved from the position
* at the start of the drag, in pixel units.
*/
drag(e: Event, currentDragDeltaXY: Coordinate) {
drag(e: PointerEvent, currentDragDeltaXY: Coordinate) {
const delta = this.pixelsToWorkspaceUnits_(currentDragDeltaXY);
const newLoc = Coordinate.sum(this.startXY_, delta);
this.draggingBlock_.moveDuringDrag(newLoc);
Expand All @@ -187,7 +187,7 @@ export class BlockDragger implements IBlockDragger {

this.draggedConnectionManager_.update(delta, this.dragTarget_);
const oldWouldDeleteBlock = this.wouldDeleteBlock_;
this.wouldDeleteBlock_ = this.draggedConnectionManager_.wouldDeleteBlock();
this.wouldDeleteBlock_ = this.draggedConnectionManager_.wouldDeleteBlock;
if (oldWouldDeleteBlock !== this.wouldDeleteBlock_) {
// Prevent unnecessary add/remove class calls.
this.updateCursorDuringBlockDrag_();
Expand All @@ -205,11 +205,11 @@ export class BlockDragger implements IBlockDragger {
/**
* Finish a block drag and put the block back on the workspace.
*
* @param e The mouseup/touchend event.
* @param e The pointerup event.
* @param currentDragDeltaXY How far the pointer has moved from the position
* at the start of the drag, in pixel units.
*/
endDrag(e: Event, currentDragDeltaXY: Coordinate) {
endDrag(e: PointerEvent, currentDragDeltaXY: Coordinate) {
// Make sure internal state is fresh.
this.drag(e, currentDragDeltaXY);
this.dragIconData_ = [];
Expand Down
9 changes: 5 additions & 4 deletions core/block_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
this.pathObject.updateMovable(this.isMovable());
const svg = this.getSvgRoot();
if (!this.workspace.options.readOnly && !this.eventsInit_ && svg) {
browserEvents.conditionalBind(svg, 'mousedown', this, this.onMouseDown_);
browserEvents.conditionalBind(
svg, 'pointerdown', this, this.onMouseDown_);
}
this.eventsInit_ = true;

Expand Down Expand Up @@ -673,11 +674,11 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
}

/**
* Handle a mouse-down on an SVG block.
* Handle a pointerdown on an SVG block.
*
* @param e Mouse down event or touch start event.
* @param e Pointer down event.
*/
private onMouseDown_(e: Event) {
private onMouseDown_(e: PointerEvent) {
const gesture = this.workspace.getGesture(e);
if (gesture) {
gesture.handleBlockStart(e, this);
Expand Down
56 changes: 28 additions & 28 deletions core/blockly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ import {DragTarget} from './drag_target.js';
import * as dropDownDiv from './dropdowndiv.js';
import * as Events from './events/events.js';
import * as Extensions from './extensions.js';
import {Field} from './field.js';
import {FieldAngle} from './field_angle.js';
import {FieldCheckbox} from './field_checkbox.js';
import {FieldColour} from './field_colour.js';
import {FieldDropdown, MenuGenerator, MenuGeneratorFunction, MenuOption} from './field_dropdown.js';
import {Field, FieldValidator} from './field.js';
import {FieldAngle, FieldAngleValidator} from './field_angle.js';
import {FieldCheckbox, FieldCheckboxValidator} from './field_checkbox.js';
import {FieldColour, FieldColourValidator} from './field_colour.js';
import {FieldDropdown, FieldDropdownValidator, MenuGenerator, MenuGeneratorFunction, MenuOption} from './field_dropdown.js';
import {FieldImage} from './field_image.js';
import {FieldLabel} from './field_label.js';
import {FieldLabelSerializable} from './field_label_serializable.js';
import {FieldMultilineInput} from './field_multilineinput.js';
import {FieldNumber} from './field_number.js';
import {FieldMultilineInput, FieldMultilineInputValidator} from './field_multilineinput.js';
import {FieldNumber, FieldNumberValidator} from './field_number.js';
import * as fieldRegistry from './field_registry.js';
import {FieldTextInput} from './field_textinput.js';
import {FieldVariable} from './field_variable.js';
import {FieldTextInput, FieldTextInputValidator} from './field_textinput.js';
import {FieldVariable, FieldVariableValidator} from './field_variable.js';
import {Flyout} from './flyout_base.js';
import {FlyoutButton} from './flyout_button.js';
import {HorizontalFlyout} from './flyout_horizontal.js';
Expand Down Expand Up @@ -101,7 +101,6 @@ import {IMetricsManager} from './interfaces/i_metrics_manager.js';
import {IMovable} from './interfaces/i_movable.js';
import {IPositionable} from './interfaces/i_positionable.js';
import {IRegistrable} from './interfaces/i_registrable.js';
import {IRegistrableField} from './interfaces/i_registrable_field.js';
import {ISelectable} from './interfaces/i_selectable.js';
import {ISelectableToolboxItem} from './interfaces/i_selectable_toolbox_item.js';
import {IStyleable} from './interfaces/i_styleable.js';
Expand Down Expand Up @@ -146,7 +145,6 @@ import {Toolbox} from './toolbox/toolbox.js';
import {ToolboxItem} from './toolbox/toolbox_item.js';
import * as Tooltip from './tooltip.js';
import * as Touch from './touch.js';
import {TouchGesture} from './touch_gesture.js';
import {Trashcan} from './trashcan.js';
import * as utils from './utils.js';
import * as colour from './utils/colour.js';
Expand Down Expand Up @@ -486,9 +484,7 @@ export function unbindEvent_(bindData: browserEvents.Data): Function {
* @param opt_noCaptureIdentifier True if triggering on this event should not
* block execution of other event handlers on this touch or other
* simultaneous touches. False by default.
* @param opt_noPreventDefault True if triggering on this event should prevent
* the default handler. False by default. If opt_noPreventDefault is
* provided, opt_noCaptureIdentifier must also be provided.
* @param _opt_noPreventDefault No-op, deprecated and will be removed in v10.
* @returns Opaque data that can be passed to unbindEvent_.
* @deprecated Use **Blockly.browserEvents.conditionalBind** instead.
* @see browserEvents.conditionalBind
Expand All @@ -497,13 +493,12 @@ export function unbindEvent_(bindData: browserEvents.Data): Function {
export function bindEventWithChecks_(
node: EventTarget, name: string, thisObject: Object|null, func: Function,
opt_noCaptureIdentifier?: boolean,
opt_noPreventDefault?: boolean): browserEvents.Data {
_opt_noPreventDefault?: boolean): browserEvents.Data {
deprecation.warn(
'Blockly.bindEventWithChecks_', 'December 2021', 'December 2022',
'Blockly.browserEvents.conditionalBind');
return browserEvents.conditionalBind(
node, name, thisObject, func, opt_noCaptureIdentifier,
opt_noPreventDefault);
node, name, thisObject, func, opt_noCaptureIdentifier);
}

// Aliases to allow external code to access these values for legacy reasons.
Expand Down Expand Up @@ -648,24 +643,31 @@ export {Cursor};
export {DeleteArea};
export {DragTarget};
export const DropDownDiv = dropDownDiv;
export {Field};
export {FieldAngle};
export {FieldCheckbox};
export {FieldColour};
export {FieldDropdown, MenuGenerator, MenuGeneratorFunction, MenuOption};
export {Field, FieldValidator};
export {FieldAngle, FieldAngleValidator};
export {FieldCheckbox, FieldCheckboxValidator};
export {FieldColour, FieldColourValidator};
export {
FieldDropdown,
FieldDropdownValidator,
MenuGenerator,
MenuGeneratorFunction,
MenuOption,
};
export {FieldImage};
export {FieldLabel};
export {FieldLabelSerializable};
export {FieldMultilineInput};
export {FieldNumber};
export {FieldTextInput};
export {FieldVariable};
export {FieldMultilineInput, FieldMultilineInputValidator};
export {FieldNumber, FieldNumberValidator};
export {FieldTextInput, FieldTextInputValidator};
export {FieldVariable, FieldVariableValidator};
export {Flyout};
export {FlyoutButton};
export {FlyoutMetricsManager};
export {CodeGenerator};
export {CodeGenerator as Generator}; // Deprecated name, October 2022.
export {Gesture};
export {Gesture as TouchGesture}; // Remove in v10.
export {Grid};
export {HorizontalFlyout};
export {IASTNodeLocation};
Expand Down Expand Up @@ -693,7 +695,6 @@ export {Input};
export {InsertionMarkerManager};
export {IPositionable};
export {IRegistrable};
export {IRegistrableField};
export {ISelectable};
export {ISelectableToolboxItem};
export {IStyleable};
Expand All @@ -719,7 +720,6 @@ export {Toolbox};
export {ToolboxCategory};
export {ToolboxItem};
export {ToolboxSeparator};
export {TouchGesture};
export {Trashcan};
export {VariableMap};
export {VariableModel};
Expand Down
1 change: 1 addition & 0 deletions core/blockly_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface BlocklyOptions {
maxBlocks?: number;
maxInstances?: {[blockType: string]: number};
media?: string;
modalInputs?: boolean;
move?: MoveOptions;
oneBasedIndex?: boolean;
readOnly?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion core/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ goog.declareModuleId('Blockly.blocks');


/**
* A block definition. For now this very lose, but it can potentially
* A block definition. For now this very loose, but it can potentially
* be refined e.g. by replacing this typedef with a class definition.
*/
export type BlockDefinition = AnyDuringMigration;
Expand Down

0 comments on commit b9e3626

Please sign in to comment.