-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: block initialization #7777
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
Merged
BeksOmega
merged 5 commits into
RaspberryPiFoundation:v11-breaks
from
BeksOmega:fix/init
Jan 18, 2024
Merged
fix: block initialization #7777
BeksOmega
merged 5 commits into
RaspberryPiFoundation:v11-breaks
from
BeksOmega:fix/init
Jan 18, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b5faae7 to
4dfa7ef
Compare
NeilFraser
approved these changes
Jan 18, 2024
BeksOmega
added a commit
that referenced
this pull request
Jan 23, 2024
* fix: reorganize initialization * chore: fix failing tests * fix: tests * chore: format * chore: remove console trace
mjgallag
added a commit
to mit-cml/blockly-plugins
that referenced
this pull request
Aug 29, 2025
#68 (comment) RaspberryPiFoundation/blockly#7777 RaspberryPiFoundation/blockly#6786 https://developers.google.com/blockly/guides/contribute/core-architecture/render-management Co-Authored-By: TannerGabriel <40315960+TannerGabriel@users.noreply.github.com>
mjgallag
added a commit
to mit-cml/blockly-plugins
that referenced
this pull request
Sep 4, 2025
* Update to Blockly 11.2.2 * Fix deprecated Blockly.inputTypes RaspberryPiFoundation/blockly@75007a0#diff-b0eef723c99dc1228104b3187ab5ff8c524198db8a12994fcbe099f9bef4b010L654-L655 * Fix headless horizontal/vertical param toggle RaspberryPiFoundation/blockly@5db9b5b#diff-d2452865ee29274f173594ba31093a2b8845c47113f7223ca0df1933e4b3de85L273-L274 RaspberryPiFoundation/blockly@5db9b5b#diff-d2452865ee29274f173594ba31093a2b8845c47113f7223ca0df1933e4b3de85R288-R291 * Fix Blockly.Drawer not found in blocky/core ewpatton/appinventor-sources@6c74e5b#diff-179ada7bc9ef841c7b52e24fe50097e0ee0aad37f7f1e4d19fec4f5323ef9785L24 * Fix init/render timing issues #68 (comment) RaspberryPiFoundation/blockly#7777 RaspberryPiFoundation/blockly#6786 https://developers.google.com/blockly/guides/contribute/core-architecture/render-management Co-Authored-By: TannerGabriel <40315960+TannerGabriel@users.noreply.github.com> * Fix block warning icon RaspberryPiFoundation/blockly@75007a0#diff-bb0de0069443e7577f62ffa96e6b51c5fafd06703f50c3eed6eb616ac87467bfL118-L124 https://developers.google.com/blockly/reference/js/blockly.blocksvg_class.setwarningtext_1_method.md * Fix renamed editable_ RaspberryPiFoundation/blockly@61bbd7d#diff-3b78eb431743f14de69af3dbc7fa1d3d158299c58ee01e47c05c33dd205165fbL191-R191 https://github.com/google/blockly/blob/blockly-v11.2.2/core/block.ts#L921-L928 * Fix block warning icon (revert comment) setWarningText checks for warning icon https://github.com/google/blockly/blob/blockly-v11.2.2/core/block_svg.ts#L972 * Fix render & code generation on dropdown change Blocky 10 caused `this.setValue(text)` to stack overflow so it was replaced with `this.doValueUpdate_(text)` which stops render & code generation. It can be removed as it's inside the field validator so the value will be set after successful validation. ewpatton/appinventor-sources@bd2cec9 ewpatton/appinventor-sources@6c74e5b#diff-179ada7bc9ef841c7b52e24fe50097e0ee0aad37f7f1e4d19fec4f5323ef9785R41 https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators --------- Co-authored-by: TannerGabriel <40315960+TannerGabriel@users.noreply.github.com> Co-authored-by: TannerGabriel <gabrieltanner.code@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Fixes #7749
Proposed Changes
Makes initiailzation for inputs and fields more consistent.
initandinitModelto match separate initialization paths for blocks and fields.Reason for Changes
Make initialization work consistently and more understandably.
Test Coverage
Tests continue to pass.
Documentation
I'm going to write dev docs at some point about the intialization / deserialization life cycle.
Additional Information
Dependent on #7748
I had to add the early return in the render management system for uninitialized blocks because we have ~200 tests that do not properly initialize the blocks. TODO: File an issue for this once this is merged.