File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src-editor/src/Components/blockly-plugins Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ Executes Javascript, Typescript Scripts.
2626<!--
2727 ### **WORK IN PROGRESS**
2828-->
29- ### 9.0.5 (2025-06-17)
29+ ### ** WORK IN PROGRESS **
3030* (@GermanBluefox ) Speed-up loading of GUI
31+ * (@GermanBluefox ) Migrating old blocks to new format
3132
3233### 9.0.4 (2025-06-16)
3334* (@GermanBluefox ) Corrected script editor for Polish language
Original file line number Diff line number Diff line change @@ -257,4 +257,18 @@ export function initBlockly(): void {
257257 ] ) ,
258258 ) ;
259259 }
260+
261+ // migrate old registry Blockly.JavaScript.my_block to new registry Blockly.JavaScript.forBlock.my_block
262+ const blocklyObject : Record < string , any > = window . Blockly . JavaScript ;
263+ if ( blocklyObject . forBlock ) {
264+ Object . keys ( blocklyObject ) . forEach ( key => {
265+ if ( typeof blocklyObject [ key ] === 'function' ) {
266+ if ( ! blocklyObject . forBlock [ key ] ) {
267+ console . log ( `Migrating Blockly.JavaScript.${ key } to Blockly.JavaScript.forBlock.${ key } ` ) ;
268+ blocklyObject . forBlock [ key ] = blocklyObject [ key ] ;
269+ delete blocklyObject [ key ] ;
270+ }
271+ }
272+ } ) ;
273+ }
260274}
You can’t perform that action at this time.
0 commit comments