Blockly v11 is here and it includes many new features and bug fixes!
For the full list of breaking changes, see the release notes below. You can click on each PR to learn why it's a breaking change, how to tell if you will be affected by it, and what to do if you are. There are a few major changes to be aware of:
- The colour, multiline input, and angle fields and their associated blocks have been removed from core. They are now available as plugins. If you use these blocks or fields, follow the instructions in the plugin READMEs to install them.
- If you install Blockly through npm, we now provide an
exports
clause to explicitly declare what you can import from our package.- Your build tooling may now throw an error if you deep import from our package such as
import 'blockly/core/some/file/name.js'
, which has never been supported by Blockly but may have been made possible by your build tools.
- Your build tooling may now throw an error if you deep import from our package such as
- We now provide Blockly as an esmodule if you use Blockly through
import
statements in JS.import Blockly from 'blockly/core'
has never been supported by Blockly, but your build tool may have "helpfully" made this work previously. Due to this change, your build tooling may no longer behave that way.- You should
import * as Blockly from 'blockly/core'
instead, as described in our documentation. - Note that
<script type="module">
in HTML files is not yet a supported method to load Blockly.
- Calling
statementToCode
orvalueToCode
on inputs that don't exist will now throw an error instead of returning an empty string.- This will make it easier to spot errors due to incorrect input names in block-code generator functions, but may expose previously silent issues with existing code.
This release also comes with many new features and bug fixes! A few notable ones include:
- Custom workspace comment behavior and appearance
- Custom draggable behavior
- More consistent undo/redo behavior for disabled blocks
- Keyboard navigation of flyout buttons
- More accurate Generator type definitions
What's Changed
Breaking changes 🛠
- fix!: have Lua generators use 'nil' instead of 'None' by @BeksOmega in #7837
- fix!: have disposing be true from start of dispose by @BeksOmega in #7891
- feat!: delete angle, colour, and multiline input fields and blocks by @rachel-fenichel in #7932
- fix!: classes on text input bubble to match comment view by @BeksOmega in #7935
- feat(build)!: Introduce
exports
section inpackage.json
by @cpcallen in #7822 - fix!: remove couldConnect parameter from wouldDelete by @BeksOmega in #7968
- feat!: Throw errors on missing inputs by @NeilFraser in #7969
- feat!: migrate bubble dragging to use new dragging API by @BeksOmega in #7974
- fix!: various drag-adjacent interfaces by @BeksOmega in #7975
- feat!: change gestures to look at selected when dragging by @BeksOmega in #7991
- feat!: Add context menu options for workspace comments by @BeksOmega in #8035
- feat!: Invalid Blocks by @johnnesky in #7958
- fix!: Only fire intermediate events when editing input with invalid text. by @johnnesky in #8054
- fix!: add getContents to IFlyout by @maribethb in #8064
- feat(build)!: Introduce ESM entrypoints by @cpcallen in #8091
New features ✨
- feat: add comment view (for workspace comments, and block comments for partners) by @BeksOmega in #7914
- feat: allow overriding comment icons by @BeksOmega in #7937
- feat: add headless workspace comment class by @BeksOmega in #7916
- feat: rendered workspace comment by @BeksOmega in #7918
- feat: have RenderedWorkspaceComment implement IBoundedElement and IRenderedElement by @BeksOmega in #7919
- feat: add JSON serialization for workspace comments by @BeksOmega in #7927
- feat(dragging): Create (new)
IDragger
andIDraggable
interfaces by @cpcallen in #7953 - feat(dragging): Introduce
Dragger
, implementingIDragger
by @cpcallen in #7956 - feat: add block drag strategy by @BeksOmega in #7970
- feat: have blocks use drag strategy by @BeksOmega in #7971
- feat: have the gesture use a dragger for blocks by @BeksOmega in #7972
- feat: make comment a draggable by @BeksOmega in #7976
- feat: allow duplicate registry values by @maribethb in #7988
- feat: support dragging comments in the gesture by @BeksOmega in #7977
- feat: support keyboard navigation of flyout buttons by @mikeharv in #7852
- feat: comment collapse event by @BeksOmega in #7949
- feat: add toFlyoutData method for compatibility with backpack by @BeksOmega in #8002
- feat: visual comment selection by @BeksOmega in #7996
- feat: add ability to delete workspace comments by @BeksOmega in #8023
- feat: add ability to copy and paste workspace comments by @BeksOmega in #8024
- feat: add block factory export in json by @maribethb in #8051
- feat: Add snapping to workspace comments. by @NeilFraser in #8070
Bug fixes 🐛
- fix!(generators): Fix generator typings by @cpcallen in #7727
- fix(generators): Fix generator type declarations by @cpcallen in #7750
- fix: export save and load procedure by @BeksOmega in #7806
- fix: connection previewer disposing too early by @BeksOmega in #7859
- fix: typo in Click event class docs by @elvisvoer in #7854
- fix: insertion marker drag scaling by @BeksOmega in #7874
- fix: restore respecting snap radius by @BeksOmega in #7873
- fix: libraryBlocks exports by @devilhyt in #7886
- fix: shouldPreventMove not being respected by @BeksOmega in #7894
- fix: connection dancing by @BeksOmega in #7899
- fix: comment min size by @BeksOmega in #7915
- fix: updated field_dropdown to properly infer its Field type with TS 5.3.3 by @btw17 in #7939
- fix(generators): Make
scrub_
public
by @cpcallen in #7940 - fix: Fix block disposal animations by @gonfunko in #7948
- fix: comment have XML save and load new workspace comments classes by @BeksOmega in #7931
- fix(typings): Restore inadvertently-deleted
typings/msg/msg.d.ts
; add TS import test by @cpcallen in #7955 - fix: comment position in RTL by @BeksOmega in #7934
- fix: comment view styling by @BeksOmega in #7965
- fix: draggable interface and concrete dragger by @BeksOmega in #7967
- fix: comment create and delete events by @BeksOmega in #7945
- fix: comment icon interface re serialization by @BeksOmega in #7964
- fix: Assign to containerDiv blockyWidgetDiv if it already exists by @lotusotho in #7980
- fix: prevent default undo by @BeksOmega in #7946
- fix: comment colours when dragging by @BeksOmega in #7978
- fix: comment move and change events by @BeksOmega in #7947
- fix: dragging shadow blocks by @BeksOmega in #7992
- fix: bubbles not being returned to the correct layer after drag by @BeksOmega in #7997
- fix: insertion marker firing move event by @BeksOmega in #8000
- fix: drag cursor by @BeksOmega in #7999
- fix: blocks not being returned to the correct layer if their drag is reverted with no parent by @BeksOmega in #7998
- fix: compatibility with scroll plugin by @BeksOmega in #8016
- fix: correct dropdown arrow placement for Thrasos on Safari by @mikeharv in #8017
- fix: backpack compatibility (rename
toFlyoutData
totoFlyoutInfo
) by @BeksOmega in #8015 - fix: dragging related exports for v11 by @BeksOmega in #8021
- fix: revert dragger name by @BeksOmega in #8020
- fix: more drag exports by @BeksOmega in #8025
- fix: text input bubble css by @BeksOmega in #8040
- fix: CSS for selected collapsed comments by @BeksOmega in #8039
- fix: comment keyboard shortcuts by @BeksOmega in #8036
- fix: bumping comments into bounds by @BeksOmega in #8037
- fix: comment text area size in samples by @BeksOmega in #8042
- fix: comments being resizable when readonly by @BeksOmega in #8043
- fix: comment highlight being positioned incorrectly in RTL by @BeksOmega in #8044
- fix(build): Reintroduce shims for subpackage entrypoints by @cpcallen in #8050
- fix: Correct list's "find" and "get" blocks help. by @NeilFraser in #8041
- fix: prevent duplication of comment icon bubbles by @riknoll in #8053
- fix: Don't record undo events for enable/disable by @NeilFraser in #8058
- fix: improve types in FieldRegistry by @maribethb in #8062
- fix: Remove deprecation warnings for 'disabled'. by @NeilFraser in #8104
- fix: drag cursor being incorrect for flyout blocks by @BeksOmega in #8107
- fix: connection db error for insertion markers by @BeksOmega in #8109
- fix: extra insertion markers being created by @BeksOmega in #8120
- fix: throwing errors for chameleon blocks by @BeksOmega in #8121
- fix: JSON deserialization not firing variable create events for blocks by @bsampada7 in #8122
- fix: workspace comment bounding box affecting RTL zoom by @samelhusseini in #8125
- fix: comment move events and snapping by @BeksOmega in #8127
- fix: change cursor to grab on ws comment bar by @maribethb in #8140
- fix: undoing block delete over trashcan creates block in wrong place by @BeksOmega in #8126
- fix: comment handle position in RTL by @BeksOmega in #8151
- fix: Zelos comments shouldn't be bold by @NeilFraser in #8141
- fix: dragging blocks by shadows to delete by @BeksOmega in #8138
- fix: comment size not respecting collapsed-ness by @BeksOmega in #8136
- fix: comment text area bottom border hidden by @BeksOmega in #8152
- fix: Properly size comments. by @NeilFraser in #8158
- fix: creating comments in RTL by @BeksOmega in #8153
- fix: delete area animation by @BeksOmega in #8149
- fix: Normalize CSS between comment types by @NeilFraser in #8161
- fix: paste in a better spot by @maribethb in #8123
Cleanup ♻️
- refactor: split out block serialization for creating new blocks from the flyout by @gonfunko in #8065
New Contributors
- @elvisvoer made their first contribution in #7854
- @devilhyt made their first contribution in #7886
- @worrycare made their first contribution in #7963
- @lotusotho made their first contribution in #7980
- @mikeharv made their first contribution in #7852
- @riknoll made their first contribution in #8053
Full Changelog: blockly-v10.4.3...blockly-v11.0.0