Skip to content

Make scratch-blocks depend on Blockly rather than forking it#3338

Merged
cwillisf merged 186 commits intodevelopfrom
spork
Mar 4, 2026
Merged

Make scratch-blocks depend on Blockly rather than forking it#3338
cwillisf merged 186 commits intodevelopfrom
spork

Conversation

@cwillisf
Copy link
Copy Markdown
Contributor

Proposed Changes

Before: scratch-blocks is a heavily modified fork of a very old version of Blockly

After: scratch-blocks lists a very recent official, unmodified version of Blockly (v12 beta) as one of its dependencies

Reason for Changes

We can use new Blockly features!
We can more easily maintain scratch-blocks!
We can keep up to date with new Blockly releases!
We can hang with the cool kids at Blockly-related parties!

Test Coverage

We should really add tests to this repo, but tests in scratch-vm and scratch-gui cover this functionality somewhat.

Thank you!

Big thanks to @BeksOmega, @gonfunko, @mmathrani, @rachel-fenichel, and everyone else who helped make this happen!

gonfunko and others added 30 commits April 12, 2024 09:36
refactor: Bootstrap scratch-blocks based on Blockly 10.
* fix: readd the operator blocks and dependencies

* fix: only import core Blockly blocks_common/math.js

Co-authored-by: Beka Westberg <bwestberg@google.com>

* fix: only import core Blockly in vertical_extensions.js

---------

Co-authored-by: Beka Westberg <bwestberg@google.com>
* fix: readd the motion blocks

* fix: use the colours_motion extension instead of hardcoding colors
* fix: readd the event blocks

* fix: only import core Blockly
* fix: readd the sound blocks

* chore: remove vestigial sound_sounds_menu implementation
* fix: readd the data blocks

* fix: import constants correctly
* fix: load CSS and fix up UI appearance

* fix: fix size of flyout section header labels
* refactor: move procedures.js into src

* fix: add support for Scratch-style procedures

* chore: remove errant logging

* refactor: remove underscore from exported callback attribute
* fix: modernize and reenable the colour slider field

* refactor: clean up FieldColourSlider

* refactor: extend the FieldColour Blockly plugin

* refactor: remove redundant setting of colour on source block
* fix: reenable support for checkboxes in the flyout

* refactor: use a map instead of an object for storing checkboxes

* chore: remove debugging code

* refactor: improve variable names for checkbox position

* chore: fix line wrapping indentation

* refactor: don't store checkbox wrapper objects on blocks
* fix: reenable the vertical separator field

* refactor: clean up field_vertical_separator.js
cwillisf and others added 17 commits January 26, 2026 12:58
…evelop

Re-implement cat block rendering in Blockly v12 terms
# [2.0.0-spork.7](v2.0.0-spork.6...v2.0.0-spork.7) (2026-02-02)

### Bug Fixes

* address minor feedback from automated review ([9971b64](9971b64))
* some silly issues and a rename ([acfb3e6](acfb3e6))
* use browserEvents.bind instead of direct binding ([b2a5d2c](b2a5d2c))
* use getters to dynamically update svg block constants ([4bd9618](4bd9618))

### Features

* abstract away some of the cat-blocks implementation logic ([c44cb57](c44cb57))
* add comment ([c88ca72](c88ca72))
* make cat-blocks code configurable behind a flag ([45a93bb](45a93bb))
fix: allow Scratch-style zoom controls as separate SVGs
# [2.0.0-spork.8](v2.0.0-spork.7...v2.0.0-spork.8) (2026-02-27)

### Bug Fixes

* allow Scratch-style zoom controls as separate SVGs ([99a40ab](99a40ab))
* **deps:** update Blockly to 12.4.1 and update its plugins ([f2e698a](f2e698a))
* make input connection highlight larger to ensure it's distinct from the input itself ([0a946b9](0a946b9))
* prefer input shape for connection hints ([e161897](e161897))
* show non-Boolean connection hints ([d4a9ff5](d4a9ff5))
# [2.0.0-spork.9](v2.0.0-spork.8...v2.0.0-spork.9) (2026-03-02)

### Bug Fixes

* add Scratch zoom controls conditionally ([6a7e36d](6a7e36d))
Specifics:

- webpack:
  - generate an ESM module instead of CommonJS
  - externalize Blockly and its plugins
- TypeScript:
  - target ES2020 instead of ES6
  - use "bundler" module resolution to align better with webpack
- Remove `/index.ts` shim now that TS and webpack are aligned
- Add/update `package.json` export fields (`main`, `types`, `exports`)

BREAKING CHANGE: code depending on this package must now understand ESM
semantic-release-bot and others added 5 commits March 3, 2026 15:33
# [2.0.0-spork.10](v2.0.0-spork.9...v2.0.0-spork.10) (2026-03-03)

* feat(build)!: modernize build output ([a2aff29](a2aff29))

### BREAKING CHANGES

* code depending on this package must now understand ESM
I can't get the `scratch-gui` build to work with externalized Blockly.
This probably needs to wait for a build system change.
# [2.0.0-spork.11](v2.0.0-spork.10...v2.0.0-spork.11) (2026-03-03)

### Bug Fixes

* **build:** don't externalize Blockly (for now) ([375ccd4](375ccd4))
@cwillisf cwillisf marked this pull request as ready for review March 4, 2026 23:14
Copy link
Copy Markdown
Contributor Author

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

We're aware of a few remaining issues, but it's time to merge this into our primary development line. 🥳

@cwillisf
Copy link
Copy Markdown
Contributor Author

cwillisf commented Mar 4, 2026

Regarding the failed checks: we have a separate agreement covering the Blockly team's contributions here, so the Signature Assistant failure is OK in this case.

@cwillisf cwillisf merged commit 7943436 into develop Mar 4, 2026
1 of 3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 4, 2026
@cwillisf cwillisf deleted the spork branch March 4, 2026 23:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants