Skip to content

blockly-v11.0.0-beta.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@cpcallen cpcallen released this 23 Dec 23:40
· 233 commits to rc/v11.0.0 since this release

This is the first in what we expect will be a series of beta releases for the future v11 of Blockly.

Blockly v11 Beta Program

We have a fairly large backlog of breaking changes that we've been holding on to, and we are planning to publish a series of betas ad hoc as those changes are finished and ready for you to test. We want to get these out to you as soon as possible, for two reasons:

  • So that you can prepare modifications to your projects as required in response to the breaking changes we're planning to include in v11.
  • So that you can give us early feedback about issues you encounter. We're interested in reports of any kind of bug, of course, but we're especially interested in hearing if a breaking change we're planning for v11 turns out to create intractable difficulties in upgrading your project(s).

It is quite likely that work on Blockly v10, including backwards-compatible bug fixes and/or new features, will continue in parallel with work on the less backwards-compatible changes we're planning for v11. We expect that in most cases each v11 beta will be up-to-date with all the latest v10 updates, but we can't make any such guarantees. As such, you should continue using v10 in production, since bugs will get fixed in v10 first, and v11 will probably introduce exciting new bugs—though with your help we hope to fix most of them before v11.0.0 is officially released.

Highlights in v11.0.0-beta.0

The only breaking change in this release is that we're finally publishing accurate TypeScript typings for the generators! 🎉

The generators were migrated to TypeScript in v10.3.0, concluding our work to migrate the core Blockly codebase from JavaScript to TypeScript. The new TypeScript implementation is (intended to be) functionally the same but a change in published typings is likely to break existing projects; to avoid this we opted to continued to publish the same hand-written .d.ts files for the generator entrypoints (e.g. blockly/javascript) that we have been using until now.

Previously the dartGenerator, luaGenerator, javascriptGenerator, phpGenerator, and pythonGenerator exports (from the blockly/dart, blockly/lua, blockly/javascript, blockly/php and blockly/python entrypoints respectively) were being typed any.
(In hindsight we should probably have declared them as unknown, obliging TS developers to use explicit casts.) Now their types are correct. There is no change to their runtime behaviour, but developers who have written code in TypeScript that manipulates generators (adding custom block generator functions, for example) may find they need to correct type errors in their code in order for it to compile correctly with Blockly v11.

Notably, block generator functions to be installed in the javascriptGenerator.forBlock dictionary should be typed

(block: Blockly.Block, generator: javascript.JavascriptGenerator) => [string, javascript.Order] | string | null

—and similarly for each of the other four languages we support.

Note that in most cases the return type for any particular generator function can be either [string, javascriptOrder] (for expression blocks), string (for statement blocks), or null (for blocks that do not directly emit code).

What's Changed

Breaking changes 🛠

Bug fixes 🐛

  • fix: Remove double spaces in translation instructions. by @NeilFraser in #7704
  • fix: updated mocha tests to display error messages by @btw17 in #7706
  • fix: prevent flyout block highlighting during workspace drag by @neerajkumarc in #7720

New Contributors

Full Changelog: blockly-v10.3.0...blockly-v11.0.0-beta.0