-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
component: generatorscomponent: library blocksissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong
Description
This is a tracking bug for the remaining work to migrate the Blockly codebase to TypeScript, following the successful migration of core/.
This is part of #5857, and will resolve #6248 and probably also #2995.
Work to be done
- Update
scripts/gulpfiles/build_tasks.jsto feed the contents ofblocks/andgenerators/throughtsc. - Update
tests/bootstrap.js, playgrounds, etc. to load blocks and generators frombuild/src/when loading uncompressed.- Turned out to be ~no work for now as they use
goog.requireso don't care about file location.
- Turned out to be ~no work for now as they use
- Create script to assist with migration (esp. of
imports). - [OPTIONAL:] Refine type of
BlockDefinition(incore/blocks.ts) to make defining blocks easier and preferably less error prone.- At the moment
BlockDefinitionisAnyDuringMigration; this works but means thattscprovides no assistance in verifying block definitions—for example, it does not check to make sure thatBlockmethods are being called (or overridden) correctly. - @cpcallen has asked a question on Stack Overflow but this has not elicited an answer yet.
- @btw17 has made some useful suggestions, including in particular defining
BlockDefinitionas{[Property in keyof Block]?: Block[Property]} & {[key: string]: unknown}, but this is not perfect: e.g. mixin methods do not get the correct type forthis.
- At the moment
- Create a model PR, migrating one file in
blocks/, to verify that the above works as intended.
blocks/
- blocks.js (refactor(blocks): Migrate
blocks/blocks.jsto TypeScript #7193) - colour.js (refactor(blocks): Migrate
blocks/colour.jsto TypeScript #6901) - lists.js (refactor(blocks): Migrate
blocks/lists.jsto TypeScript #6902) - logic.js (refactor(blocks): Migrate
blocks/logic.jsto TypeScript #7003) - loops.js (refactor(blocks): Migrate
blocks/loops.jsto TypeScript #6957) - math.js (refactor(blocks): Migrate
blocks/math.jsto TypeScript #6900) - procedures.js (refactor(blocks): Migrate
blocks/procedures.jsto TypeScript #7192 ) - text.js (refactor(blocks): Migrate
blocks/text.jsto TypeScript #6958) - variables.js (refactor(blocks): Migrate
blocks/variables.jsandblocks/variables_dynamic.jsto TypeScript #7001) - variables_dynamic.js (refactor(blocks): Migrate
blocks/variables.jsandblocks/variables_dynamic.jsto TypeScript #7001)
generators/
-
dart.js
- dart/dart_generator.js
- dart/colour.js
- dart/lists.js
- dart/logic.js
- dart/loops.js
- dart/math.js
- dart/procedures.js
- dart/text.js
- dart/variables.js
- dart/variables_dynamic.js
-
javascript.js
- javascript/javascript_generator.js
- javascript/colour.js
- javascript/lists.js
- javascript/logic.js
- javascript/loops.js
- javascript/math.js
- javascript/procedures.js
- javascript/text.js
- javascript/variables.js
- javascript/variables_dynamic.js
-
lua.js
- lua/lua_generator.js
- lua/colour.js
- lua/lists.js
- lua/logic.js
- lua/loops.js
- lua/math.js
- lua/procedures.js
- lua/text.js
- lua/variables.js
- lua/variables_dynamic.js
-
php.js
- php/php_generator.js
- php/colour.js
- php/lists.js
- php/logic.js
- php/loops.js
- php/math.js
- php/procedures.js
- php/text.js
- php/variables.js
- php/variables_dynamic.js
-
python.js
- python/python_generator.js
- python/colour.js
- python/lists.js
- python/logic.js
- python/loops.js
- python/math.js
- python/procedures.js
- python/text.js
- python/variables.js
- python/variables_dynamic.js
Metadata
Metadata
Assignees
Labels
component: generatorscomponent: library blocksissue: bugDescribes why the code or behaviour is wrongDescribes why the code or behaviour is wrong