Update Angular Sample to latest version 7.20211209.1 - TypeScript definitions problem
Category
- Examples
Component
examples\blockly-angular
Describe the bug
The latest version of blockly 7.20211209.1 has many problems in blockly.d.ts .
Even if the Angular is upgraded to version 13 and TypeScript to 4.5, the errors occurs
To Reproduce
Steps to reproduce the behavior:
- Go to examples\blockly-angular and update to latest Angular ( or create a new Angular 13 site )
- Run ng serve to see that the angular works
- run npm i [email protected] to update to this version
- Run ng server
- See error
Expected behavior
Latest version should work with Angular without TypeScript problems from block.d.ts
Additional context
Encountered bug when trying to update from blockly 6 to 7 at https://ignatandrei.github.io/BlocklyAutomation/ . ( the reason of this update is another difficult to reproduce bug)
Thanks for the issue! Would you mind providing more information on the errors that you are getting? This quarter our types are incomplete as noted in the "Watch out for" section of the release notes. Our current plan is to continue migrating to typescript. Ideally this means that our types should be more complete after next quarter.
Hello The error is basically due to the fact that Blockly.getMainWorkspace() is not available when I define new blocks As (one of ) result, the code from
https://github.com/google/blockly/blob/master/core/dropdowndiv.js
DropDownDiv.getContentDiv = function() {
return DropDownDiv.content_;
};
returns undefined when clicking on dropdown. and gesture never finishes
I can reproduce reliably on my system ( windows) and on build on GitHub actions ( ubuntu)
This is the original bug: https://github.com/ignatandrei/BlocklyAutomation/issues/38
This is affecting just the dropdowns as I see.
If you download the Angular project from http://github.com/ignatandrei/BlocklyAutomation ( run npm install in C:\Users\Surface1\Documents\GitHub\BlocklyAutomation\src\AngWorkspace and in each associated projects ), you will see the error by browsing to http://localhost:4200/automation/loadexample/err38 ( or search in the blocks to err )
Nice issue! Documentating/updating the angular-blockly sample would help us Angular dev's very much, but I'm concerned that this approach can somehow "hide" or provide a false-positive that the problems with the types will be fixed.
I would like to add that, the problems with the last release (version 7) that brought to Blcokly several Typescript-based updates aren't limited to the "getMainWorkspace()" function, but it extends to another namespaces, I'm not being able to access "Blockly.Msg" (array of translations) for example, and much other functions and namespaces stopped working properly after that update.
Hope it would be fixed soon, good job on the coolest lib ever made!
This example is now on Angular 15 and Blockly 10 and seems to be working fine - closing this accordingly, but please feel free to reopen if issues remain.